tf.sign

tf.sign

tf.sign

sign(
    x,
    name=None
)

Defined in tensorflow/python/ops/math_ops.py.

See the guide: Math > Basic Math Functions

Returns an element-wise indication of the sign of a number.

y = sign(x) = -1 if x < 0; 0 if x == 0 or tf.is_nan(x); 1 if x > 0.

Zero is returned for NaN in