torch.sgn
- torch.sgn(input, *, out=None) → Tensor
This function is an extension of torch.sign() to complex tensors. It computes a new tensor whose elements have the same angles as the corresponding elements of
inputand absolute values (i.e. magnitudes) of one for complex tensors and is equivalent to torch.sign() for non-complex tensors.