attribench.data.IndexDataset

class attribench.data.IndexDataset(dataset)[source]

Bases: Dataset

Wraps a dataset to return the index of the sample as well. Used internally to keep track of the index of a sample in a dataset.

Parameters:
datasetDataset

The PyTorch Dataset to wrap.

Methods