tensor.sign
Calculates the sign of the given input tensor element-wise. If input > 0, output 1. if input < 0, output -1. if input == 0, output 0.
Args
self
(@Tensor<T>
) - Tensor of data to calculates the sign of the given input tensor element-wise.
Returns
A new Tensor<T>
of the same shape as the input tensor with The sign of the input tensor computed element-wise.
Example
Last updated