If you know the form of the session, this may help.
import tensorflow as tf import numpy as np v = tf.Variable([], validate_shape=False) with tf.Session() as sess: sess.run(tf.global_variables_initializer()) print(sess.run(v, feed_dict={v: np.zeros((3,4))})) print(sess.run(v, feed_dict={v: np.zeros((2,2))}))
source share