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

Why does torchtext.data.Batch.to() not exist? #861

Closed
awaelchli opened this issue Jun 29, 2020 · 2 comments
Closed

Why does torchtext.data.Batch.to() not exist? #861

awaelchli opened this issue Jun 29, 2020 · 2 comments
Labels

Comments

@awaelchli
Copy link

❓ Questions and Help

Description
I am wondering why the Batch class does not support moving the data to the device with a ".to()" call like it is possible for tensors and nn modules. Since the attribute of this Batch object are tensors, wouldn't it be straightforward to implement this convenience method?

Thanks

@zhangguanheng66
Copy link
Contributor

Just a reminder that we will retire Batch class. The batched data from DataLoader can be moved to device.

@awaelchli
Copy link
Author

Ok got it, makes sense not to add it if you drop that anyway. Thanks!

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

No branches or pull requests

2 participants