Is there any relation between index in __getitem__ method and what __len__ returns?

How pytorch manages to give index the value?, is it something depending on the length returned from len method?

The dataloader will permust the sequence 0…len-1 and then use these as indices on getitem.

1 Like

Thanks for the clarification @tom. I initially thought of that but anyway thanks for making it clear.