mercredi 1 novembre 2023

Why is torch.randn not been reproducible with all seeding?

Title says it all, here is my issue:

I want torch.randn(1) to be reproducible.

I am using CUDA and have tried the following to seed it.

seed=42
torch.manual_seed(seed=seed)
torch.cuda.manual_seed_all(seed=seed)
np.random.seed(seed=seed)
torch.backends.cudnn.deterministic = True
torch.use_deterministic_algorithms(True)
torch.backends.cudnn.benchmark = False 

torch.randn(1)

I was expecting a constant value as an output.




Aucun commentaire:

Enregistrer un commentaire