Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should SafeDataset drop __getitem__ and inherrit IterableDataset? #30

Open
rehno-lindeque opened this issue Dec 22, 2020 · 1 comment
Open

Comments

@rehno-lindeque
Copy link

I quickly looked under the hood of this library because I needed to handle None values in my own dataset, but felt suspicious that this is trying to do something impossible.

Looking at https://github.com/msamogh/nonechucks/blob/master/nonechucks/dataset.py#L87-L96, I am under the impression that __getitem__ will return the same value for multiple indices. E.g. suppose index 2 is None, then dataset[2] == dataset[3].

Surely that doesn't make sense for a well-behaved map-style dataset?

Alternatively indices could be remapped via a Dict[int,int] for random access.

@sammlapp
Copy link

Yes, this is not the behavior I expected but is indeed what happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants