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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

torch.chunk returns Tuple, not List #126278

Open
Daniel-Chin opened this issue May 15, 2024 · 2 comments
Open

torch.chunk returns Tuple, not List #126278

Daniel-Chin opened this issue May 15, 2024 · 2 comments
Labels
actionable module: typing Related to mypy type annotations module: viewing and reshaping triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@Daniel-Chin
Copy link

Daniel-Chin commented May 15, 2024

馃摎 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

@cpuhrsch
Copy link
Contributor

Marked for triage review to discuss what we want to do here

@drisspg drisspg added module: typing Related to mypy type annotations actionable and removed triage review labels May 20, 2024
@drisspg
Copy link
Contributor

drisspg commented May 20, 2024

Although the the typed named is a tensorlist in return values for this type are always tuples in python. This is actionable and we want to update the signature in pyi to reflect that this always returns a tuple

@janeyx99 janeyx99 added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable module: typing Related to mypy type annotations module: viewing and reshaping triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

4 participants