chainerx.sign

chainerx.sign(x)

Returns an element-wise indication of the sign of a number. The sign function returns \(-1 if x < 0, 0 if x==0, 1 if x > 0\). nan is returned for nan inputs. :param x: Input array. :type x: ~chainerx.ndarray

Returns

The sign of x.

Return type

ndarray

See also

numpy.sign