Skip to content

Retire legacy code in torchtext #3529

@zhangguanheng66

Description

@zhangguanheng66

❓ Questions and Help

As the maintainer of the torchtext library, we plan to retire torchtext.data.batch.Batch and torchtext.data.example.Example in the next release (by the end of October). Those two components will be still available in torchtext.legacy. To handle the compatibility issue, should we send a PR and fix this on GitHub first, or we could just make some changes in fbcode?

Here are the proposed changes:

# old API
from torchtext.data.batch import Batch
from torchtext.data.example import Example

# new API
from torchtext.legacy.data.batch import Batch
from torchtext.legacy.data.example import Example

Relevant issue: pytorch/text#985

Metadata

Metadata

Assignees

No one assigned

    Labels

    designIncludes a design discussionfeatureIs an improvement or enhancementlet's do it!approved to implementpriority: 1Medium priority task

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions