In [3]:
import tensorflow as tf
hello = tf.constant("hello Tensorflow!")
sess = tf.Session()
In [4]:
print(sess.run(hello))
In [7]:
x=1
y=x+9
print(y)
x = tf.constant(1, name='x')
y = tf.Variable(x+9, name='y')
print(y)
In [8]:
model = tf.initialize_all_variables()
with tf.Session() as sess:
sess.run(model)
print(sess.run(y))
In [9]:
a = tf.placeholder("int16")
b = tf.placeholder("int16")
y = tf.mul(a,b)
sess = tf.Session()
print(sess.run(y, feed_dict={a:2,b:5}))
In [ ]: