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

Implement __len__() for StreamingDataSilo #274

Merged
merged 2 commits into from
Mar 13, 2020

Conversation

tanaysoni
Copy link
Contributor

The StreamingDataSilo uses PyTorch's IterableDataSet for yielding the datasets. The IterableDataSet do not have an implementation for __len__(). However, in FARM, there are few instances where we use the length of datasets/dataloaders.

The PR adds __len__() on the _StreamingDataSet(total number of samples) and NamedDataLoader(total number of batches). This makes the behaviour of calling len() on the StreamingDataSilo consistent with that of DataSilo.

@tanaysoni tanaysoni requested a review from tholor March 6, 2020 13:09
Copy link
Member

@tholor tholor left a comment

Choose a reason for hiding this comment

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

Looking good

@tholor tholor merged commit 18d94af into master Mar 13, 2020
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.

None yet

2 participants