File size: 178 Bytes
a6dac9a
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
import random
import numpy as np
import torch


def random_seed(seed=42, rank=0):
    torch.manual_seed(seed + rank)
    np.random.seed(seed + rank)
    random.seed(seed + rank)