I find g.manual_seed(self.epoch) in the distributedSampler class. However, I enter the Genetator class and find the method content is pass. I am reading the code of example/imagenet/main.py.
Can any one tell me what’s the function of this line?
I find g.manual_seed(self.epoch) in the distributedSampler class. However, I enter the Genetator class and find the method content is pass. I am reading the code of example/imagenet/main.py.
Can any one tell me what’s the function of this line?
In which file are you looking?
It sounds like Generator is a class. There is probably some child class that extends Generator and provides a non-pass manual_seed method.
data/distributed.py and distributedsampler class
Thanks, found it here. Do you know where the code for the Generator class is located? (sorry, I’m having a little trouble finding it!)
torch._c.Generator.py Thanks for your help!
Okay I think manual_seed is implemented here: https://github.com/pytorch/pytorch/blob/ff9d1aeab5d943cfb549cd3257ab7129a624b1e9/torch/csrc/Generator.cpp#L81
Please let me know if that helps
OK. Thanks for your help. I will read it later, I am not good at C++.
Thank you again!