官网链接:https://www.tensorflow.org/api_docs/python/tf/math/log
tf.math.log(
x,
name=None
)
x
是张量,对x
按元素取自然底对数
o
u
t
p
u
t
=
l
n
x
output=ln x
output=lnx
实例:
import tensorflow as tf
e = 2.71828183
a = tf.constant([e, e*e, e*e*e])
tf.global_variables_initializer()
with tf.Session() as sess:
print(sess.run(tf.log(a)))
[0.99999994 2. 3. ]