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

Double check for attribute num_examples #12562

Merged
merged 2 commits into from
Jul 7, 2021
Merged

Double check for attribute num_examples #12562

merged 2 commits into from
Jul 7, 2021

Conversation

sgugger
Copy link
Collaborator

@sgugger sgugger commented Jul 7, 2021

What does this PR do?

As pointed out by #12479, the isinstance check for IterableDataset and its subclasses does not look at the type, but whether the class implements some methods, but not all attributes. This PR adds a double check when necessary to avoid an AttributeError.

Fixes #12479

@sgugger sgugger requested a review from LysandreJik July 7, 2021 14:35
Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sgugger
Copy link
Collaborator Author

sgugger commented Jul 7, 2021

Failure looks unrelated but circleCI is not letting me re-run the tests, so merging and watching master.

@sgugger sgugger merged commit b868260 into master Jul 7, 2021
@sgugger sgugger deleted the fix_12479 branch July 7, 2021 16:50
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

Successfully merging this pull request may close these issues.

AttributeError when using custom IterableDataset with set_epoch method
2 participants