Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Thanirin committed Feb 10, 2019
0 parents commit 1dec33d
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions first-tensorflow.py
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 added graphs/events.out.tfevents.1549784302.RINZZZ
Binary file not shown.
Binary file added graphs/events.out.tfevents.1549784644.RINZZZ
Binary file not shown.
Binary file added graphs/events.out.tfevents.1549785014.RINZZZ
Binary file not shown.
Binary file added graphs/events.out.tfevents.1549785362.RINZZZ
Binary file not shown.
Binary file added graphs/events.out.tfevents.1549785434.RINZZZ
Binary file not shown.
16 changes: 16 additions & 0 deletions second-tensorflow.py
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()

0 comments on commit 1dec33d

Please sign in to comment.