Add an example to tf.math.sign docstring.
PiperOrigin-RevId: 270098114
This commit is contained in:
parent
d4649a978b
commit
c0687c0e12
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user