Skip to content

torch.chunk returns Tuple, not List #126278

@Daniel-Chin

Description

@Daniel-Chin

📚 The doc issue

Both

claim that the return type of torch.chunk is List[Tensor], whereas in reality it is Tuple[Tensor] according to

  • The "Example" section on that exact documentation page and
  • local testing with pytorch 2.1.0.

Suggest a potential alternative/fix

Fix the doc and the annotations.

cc @ezyang @malfet @xuzhao9 @gramster

Metadata

Metadata

Assignees

No one assigned

    Labels

    actionablemodule: typingRelated to mypy type annotationsmodule: viewing and reshapingtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions