train_data = tf.Variable(999)
test_data = tf.Variable(1000)
select_test = tf.placeholder(dtype=bool, shape=[], name='select_test')
data = tf.cond(select_test, lambda : test_data, lambda : train_data)
model = data - 500
init = tf.initialize_all_variables()
with tf.Session():
    init.run()
print(model.eval({select_test: False}))
print(model.eval({select_test: True}))
Feeding tensors for training vs validation data