x = tf.placeholder(tf.float32, shape=[None])
i = tf.placeholder(tf.int32, shape=[1])
y = tf.slice(x, i, [1])
init = tf.initialize_all_variables()
sess = tf.Session()
sess.run(init)
result = sess.run(y, feed_dict={x: [1, 2, 3, 4, 5], i: [0]})
print(result)
Нарезка Tensorflow на основе переменной