-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Labels
module: cudaRelated to torch.cuda, and CUDA support in generalRelated to torch.cuda, and CUDA support in generaltriagedThis 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
To Reproduce
import torch
x = torch.ones(0).cuda()
print(x.float().max().item()) # -inf
print(x.int().max().item()) # 0Expected behavior
print(x.int().max().item()) should output the lowest numeric limit for the integer type.
Note
The same issue arises for all integral types: byte, short, int and long.
Related to #19612.
Metadata
Metadata
Assignees
Labels
module: cudaRelated to torch.cuda, and CUDA support in generalRelated to torch.cuda, and CUDA support in generaltriagedThis 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