Sorry if I wasn’t being clear. My specific problem is that the PyTorch Dataset class has a get_item function that requires an index. My problem is that I don’t know if data at a certain index will be used or not until I load it and check it’s flag to see if I should ignore it. Each time get_item is called I need to return something, so this hasn’t been working for me. Is there a way I can tell the pytorch dataset class to skip a particular index after a call to get_item?