Hi @ptrblck. I have a possibly unrelated question regarding this tutorial’s code.
Why is the following code snippet included in the __getitem__
function:
...
if torch.is_tensor(idx):
idx = idx.tolist()
...
In my understanding, the method can only read one sample, as only one image file can only be read by io.imread()
. Giving multiple indices should raise an error. The tolist()
method here seems a bit confusing. Could you give some comments on that? Thanks for your reply in advance.