-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Labels
actionablemodule: docsRelated to our documentation, both in docs/ and docblocksRelated to our documentation, both in docs/ and docblocksmodule: reductionsmodule: type promotionRelated to semantics of type promotionRelated to semantics of type promotiontriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
🐛 Describe the bug
Repro:
In [1]: import torch
...: dtypes = [torch.bool, torch.int8, torch.int32, torch.bfloat16, torch.float32, torch.float64]
...: for dtype in dtypes:
...: a = torch.tensor([], dtype=dtype)
...: a_sum = a.sum()
...: if a.dtype != a_sum.dtype:
...: print(f"t.dtype != t.sum().dtype, got {a.dtype} != {a_sum.dtype}")
...:
t.dtype != t.sum().dtype, got torch.bool != torch.int64
t.dtype != t.sum().dtype, got torch.int8 != torch.int64
t.dtype != t.sum().dtype, got torch.int32 != torch.int64This is the cause of #82150.
Versions
Current master.
Metadata
Metadata
Assignees
Labels
actionablemodule: docsRelated to our documentation, both in docs/ and docblocksRelated to our documentation, both in docs/ and docblocksmodule: reductionsmodule: type promotionRelated to semantics of type promotionRelated to semantics of type promotiontriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module