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

add __len__ to get dp length #1289

Closed
wants to merge 1 commit into from
Closed

add __len__ to get dp length #1289

wants to merge 1 commit into from

Conversation

kaiyuyue
Copy link

dp = ...
dp = dp.load_from_tar(length=ds_length)  # now __len__ will return self.length
dp = dp.webdataset()  # inherit self.length in the __len__

print(len(dp))  # able to get dp length

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 20, 2024
@andrewkho
Copy link
Contributor

Hi @kaiyuyue, please see #1196 as we won't be supporting dataloader2 nor datapipes in torchdata moving forward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. datapipes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants