Add an example to tf.math.sign docstring.

PiperOrigin-RevId: 270098114
This commit is contained in:
Kibeom Kim 2019-09-19 12:21:32 -07:00 committed by TensorFlower Gardener
parent d4649a978b
commit c0687c0e12

View File

@ -5,5 +5,9 @@ op {
`y = sign(x) = -1` if `x < 0`; 0 if `x == 0`; 1 if `x > 0`.
For complex numbers, `y = sign(x) = x / |x|` if `x != 0`, otherwise `y = 0`.
Example usage:
>>> tf.math.sign([0., 2., -3.])
<tf.Tensor: id=16, shape=(3,), dtype=float32, numpy=array([ 0., 1., -1.], dtype=float32)>
END
}