Does PyTorch have a RandomState-like object for random number generation?
in numpy i can

import numpy as np

rs = np.random.RandomState(seed=0)


and then pass that object around, eg for dependency injection.

Does PyTorch have a similar interface? I can't find anything in the docs, but maybe i'm missing something.

The closest thing would be torch.manual_seed, which sets the seed for generating random numbers and returns a torch.Generator. This thread here has more information, apparently there may be some inconsistencies depending on whether you are using GPU or a CPU. 
