Torch.manual_seed(0) doesn't work with randint?

I am using torch.manual_seed(0) before randint to always generate the same numbers, but it doesnt work…

torch.manual_seed(0)
test_numbers = np.random.randint(1, 500,  100 , dtype=np.uint8)

everytime the array is different… why?

torch.manual_seed will seed the PyTorch random number generator, not the ones from 3rd party libraries such as numpy, so you would either need to use torch.randint or seed numpy via np.random.seed.