Created
September 10, 2019 10:36
-
-
Save lawrencechen0921/401a430fc24e3aa899e791f0cf9de19b to your computer and use it in GitHub Desktop.
tensorflow的資料流t 新手教學
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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