Spaces:
Running
on
Zero
Running
on
Zero
File size: 245 Bytes
4d5065f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
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)
|