tensorflow output hello world 2

import tensorflow as tf


# 使用TensorFlow输出Hello

# 创建一个常量操作( Constant op )
# 这个 op 会被作为一个节点( node )添加到默认计算图上.
#
# 该构造函数返回的值就是常量节点(Constant op)的输出.
hello = tf.constant('Hello, tf!')

# 启动TensorFlow会话
sess = tf.Session()


# 运行 hello 节点
print(sess.run(hello))
sess.close()

 

Published 92 original articles · Likes5 · Visitors 10,000+

Guess you like

Origin blog.csdn.net/xfb1989/article/details/105417713