Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

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

@awaelchli

Description

@awaelchli

❓ 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions