10 lines
178 B
10 lines
178 B
4 years ago
|
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)
|