Here, newIndices is just a list of indices to use in my subset.
I want to analyze the logits I get on a forward pass, so I need to pass all the data of the subset into my model at once.
This gives me the error that Subset has no attribute ‘data’, and I get the same issue with ‘targets’. Is there a simple fix to this, to access all the subset data/targets and not the original set?
You would need to iterate the Subset and store the data/targets in e.g. new tensors or a list.
The internal Dataset could lazily load the samples in its __getitem__ so you won’t be necessarily able to access a .data or .target attribute as it might not exist until you actually load the sample.
However, if you know that your Dataset pre-loading the data and indeed uses these internal attributes, you might be able to index them via newIndices assuming both are tensors.