GenPercept / util /seed_all.py
guangkaixu's picture
upload
4d5065f
raw
history blame
245 Bytes
import numpy as np
import random
import torch
def seed_all(seed: int = 0):
"""
Set random seeds of all components.
"""
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)