tristandeleu / pytorch-meta

A collection of extensions and data-loaders for few-shot learning & meta-learning in PyTorch
https://tristandeleu.github.io/pytorch-meta/
MIT License
1.97k stars 256 forks source link

where is self.np_random being assigned? #81

Closed renesax14 closed 4 years ago

renesax14 commented 4 years ago

it is not in the constructor

https://github.com/tristandeleu/pytorch-meta/blob/9d34b837440df4e3790fc2faaffaacfa257f4223/torchmeta/toy/sinusoid.py#L48

so it's being assigned out of the blue somewhere else. Why? this seems dangerous and hard to read/maintain.

tristandeleu commented 4 years ago

This is defined in the parent class MetaDataset here: https://github.com/tristandeleu/pytorch-meta/blob/9d34b837440df4e3790fc2faaffaacfa257f4223/torchmeta/utils/data/dataset.py#L200-L203