Tensorflow源码分析–tf.abs()
标签(空格分隔): Tensorflow
tf.abs()
import tensorflow as tf
x = tf.constant([[-2.25 + 4.75j], [-3.25 + 5.75j]])
sess = tf.Session()
print(sess.run(tf.abs(x)))
>>>[[5.25594901]
[6.60492241]]
该函数源码:
路径:tensorflow-master\tensorflow\python\ops\math_ops.py
with ops.name_scope(name, "Abs", [x]) as name: