-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thanirin
committed
Feb 10, 2019
0 parents
commit 1dec33d
Showing
8 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import tensorflow as tf | ||
|
||
a = tf.constant(2, name="a") | ||
b = tf.constant(3, name="b") | ||
x = tf.add(a, b, name="add") | ||
|
||
with tf.Session() as session: | ||
writer = tf.summary.FileWriter('./graphs', session.graph) | ||
print(session.run(x)) | ||
|
||
writer.close() |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import tensorflow as tf | ||
|
||
# constant 1D tensor (vector) | ||
a = tf.constant([2, 2], name="vector") | ||
|
||
# constant 2x2 tensor (matrix) | ||
b = tf.constant([[0, 1], [2, 3]], name="b") | ||
|
||
# create a tensor of shape and all elements are 0s | ||
a = tf.zeros([2, 3], tf.int32) | ||
|
||
with tf.Session as session: | ||
writer = tf.summary.FileWriter('./graphs', session.graph) | ||
print(session.run(a)) | ||
|
||
writer.close() |