tensorflow 输出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()

发布了92 篇原创文章 · 获赞 5 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/xfb1989/article/details/105417713