Skip to content

Commit 69135b9

Browse files
ev-brlezcano
andcommitted
BUG: isreal for real args is all-true
Co-authored-by: Mario Lezcano Casado <[email protected]>
1 parent 59c6596 commit 69135b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch_np/_detail/implementations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def tensor_iscomplex(x):
5454
def tensor_isreal(x):
5555
if torch.is_complex(x):
5656
return torch.as_tensor(x).imag == 0
57-
result = torch.zeros_like(x, dtype=torch.bool)
57+
result = torch.ones_like(x, dtype=torch.bool)
5858
if result.ndim == 0:
5959
result = result.item()
6060
return result

0 commit comments

Comments
 (0)