Does torch.manual_seed include the operation of torch.cuda.manual_seed_all?
If yes, we can just use torch.manual_seed to set the seed. Otherwise we should call both functions.
Does torch.manual_seed include the operation of torch.cuda.manual_seed_all?
If yes, we can just use torch.manual_seed to set the seed. Otherwise we should call both functions.
Yes, torch.manual_seed() does include CUDA:
You can use
torch.manual_seed()to seed the RNG for all devices (both CPU and CUDA):
See Pytorch lightning's seed_everything:
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
Makes me believe these are all and only the required seeds.