根据 https://github.com/aymericdamien/TensorFlow-Examples 学习TensorFlow
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
其中第二行定义了常量hello,在TensorFlow中,tf.constant(value, dtype=None, shape=None, name='Const'),其中value表示值,dtype表示类型,shape可用于返回矩阵,向量等,name为结果的名字,tf.constant 返回一个常量张量。
第三行开始了一个session,第四行输出hello。