Skip to content

Instantly share code, notes, and snippets.

@arafatkatze
Last active January 4, 2017 06:28
Show Gist options
  • Save arafatkatze/e461c8b0d2f0043213741c27eaecc02f to your computer and use it in GitHub Desktop.
Save arafatkatze/e461c8b0d2f0043213741c27eaecc02f to your computer and use it in GitHub Desktop.
from __future__ import print_function
import tensorflow as tf
FLAGS = None
a = tf.constant([[2, 3],[4,1]])
b = tf.constant([[5, 6],[1,3]])
d = tf.constant([[0, 4],[9,8]])
with tf.Session() as sess:
c = sess.run(a+b)
print("a+b = c\n",c)
# a+b = c
# [[7 9]
# [5 4]]
e = sess.run(c*d)
print ("c*d = e\n",e)
# c*d = e
# [[ 0 36]
# [45 32]]
train_writer = tf.summary.FileWriter('/tmp/example',sess.graph)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment