1.功能
计算输入的x的倒数
2.参数
x:是Tensor,数据类型必须是`float16`, `half`, `float32`, `float64`, `int32`, `int64`, `complex64`, `complex128`.
3.样例代码
import tensorflow as tf
from tensorflow.python.ops import gen_math_ops
intpu_x = tf.constant(3, dtype=tf.float16, name='intpu_x')
out = gen_math_ops.inv(intpu_x)
with tf.Session() as sess:
out_ = out.eval()
print(out_)
# 结果是 0.3333