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

import random

import numpy as np

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.