pytorch
aa891188 - [chalf] warn once on creating a chalf tensor (#78245) (#78710)

Commit
3 years ago
[chalf] warn once on creating a chalf tensor (#78245) (#78710) `chalf` is experimental as the op coverage is low. Following script raises 6 warnings if `set_warn_always(True)` else raises only 1 warning. ```python import torch torch.set_warn_always(True) device='cpu' t = torch.randn(3, dtype=torch.chalf, device=device) y = torch.rand(3, dtype=torch.chalf, device=device) # Allocates new tensor for result t + y device='cuda' t = torch.randn(3, dtype=torch.chalf, device=device) y = torch.rand(3, dtype=torch.chalf, device=device) # Allocates new tensor for result t + y ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/78245 Approved by: https://github.com/anjali411
Author
Parents
Loading