标签:直接 info 输出 tensor ssi bsp pytho alt com



import tensorflow as tf
const = tf.constant(3)
print(const) # Tensor("Const:0", shape=(), dtype=int32)
a = 3
print(a) # 3
# 可以看到如果直接打印const是不会输出3这个结果的,tensor不具备计算出值的能力,必须创建会话
sess = tf.Session()
print(sess.run(const)) # 3
标签:直接 info 输出 tensor ssi bsp pytho alt com
原文地址:https://www.cnblogs.com/traditional/p/9339211.html