In [1]:
#Placeholders: Feed data later and build the graph now.

import tensorflow as tf

x = tf.placeholder("float", None)
y = x*2

with tf.Session() as session:
    result = session.run(y, feed_dict={x:[1,2,3]})
    print(result)


[ 2.  4.  6.]

In [4]:
x = tf.placeholder("float", None)  # None :  Any number of dimension
y = x*2

with tf.Session() as session:
    xData = [
        [1, 2, 3],
        [4, 5, 5]
    ]
    result = session.run(y, feed_dict={x:xData})
    print(result)


[[  2.   4.   6.]
 [  8.  10.  10.]]

In [5]:
# Graphs are created for the operations and the variables.
# The variables are called tensors.

In [10]:
session = tf.InteractiveSession()
x = tf.constant(list(range(10)))
print(x.eval())
session.close()


[0 1 2 3 4 5 6 7 8 9]