Skip to content

Instantly share code, notes, and snippets.

@lawrencechen0921
Created September 10, 2019 10:36
Show Gist options
  • Save lawrencechen0921/401a430fc24e3aa899e791f0cf9de19b to your computer and use it in GitHub Desktop.
Save lawrencechen0921/401a430fc24e3aa899e791f0cf9de19b to your computer and use it in GitHub Desktop.
tensorflow的資料流t 新手教學
import tensorflow as tf
a = tf.constant(1, name='a')
b = tf.constant(1, name='b')
c = a+b
with tf.Session as sess: #注意以上的session將a,b 視為個體, 否則跑出來的結果會為不同
print(sess.run(c))
import tensorflow as tf
a = tf.constant(1, name='a')
b = tf.constant(1, name='b')
c=a+b
print(C)
#結果大不相同
import tensorflow as tf
a = tf.constant(1, name='a')
b = tf.constant(1, name='b')
graph= tf.get_default_graph()
print(graph.as graph_def())
#即可畫出流程圖
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment