input = tf.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
output = tf.gather(input, 0)
print(sess.run(output))
output = tf.gather(input, [0, 2])
Tensorflow python : Accessing individual elements in a tensor