根據 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。