Seed setup for random number generator to ensure reproducibility

According to the reproducibility session of Pytorch Doc, we can set seed for random number generator in Pytorch, python, and numpy-related libraries respectively.

import torch
torch.manual_seed(0)

import random
random.seed(0)

import numpy as np
np.random.seed(0)

For a generic ML workflow, involving numpy-based libraries, like scikit-learn; and pytorch, etc. The best practice to ensure reproducibility is to set the seed using all the above three ways. Is that right?

Yes, that’s right, but the linked docs also mention more needed steps to ensure reproducibility between runs, so you would also need to check these points.