Best practices for generating a random seed to seed Pytorch?

What I really want is to seed the dataset and dataloader. I am adapting code from:

Anyone know how to seed this properly? What are the best practices for seeding things in Pytorch.

Honestly, I have no idea if there is an algorithm specific way for GPU vs CPU. I care mostly about general pytorch and make sure my code is “truly random”. Specially when it uses GPU I guess…

related: