8000 Update on "torch.sgn for complex tensors" · pytorch/pytorch@9354172 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9354172

Browse files
committed
Update on "torch.sgn for complex tensors"
resolves #36323 by adding `torch.sgn` for complex tensors. `torch.sgn` returns `x/abs(x)` for `x != 0` and returns `0 + 0j` for `x==0` This PR doesn't test the correctness of the gradients. It will be done as a part of auditing all the ops in future once we decide the autograd behavior (JAX vs TF) and add gradchek. [ghstack-poisoned]
1 parent b4b37c7 commit 9354172

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch/_torch_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5725,7 +5725,7 @@ def merge_dicts(*dicts):
57255725

57265726
add_docstr(torch.sgn,
57275727
r"""
5728-
sgn(input, out=None) -> Tensor
5728+
sgn(input, *, out=None) -> Tensor
57295729
57305730
Returns a new complex tensor with the same angle as that of the elements of :attr:`input` and absolute value 1.
57315731

0 commit comments

Comments
 (0)
0