"""Sets the value of a tensor variable,
from a Numpy array.
"""
tf.assign(x, np.asarray(value)).op.run(session=get_session())
def batch_set_value(tuples):
After Change
from a Numpy array.
"""
value = np.asarray(value)
tf_dtype = _convert_string_dtype(x.dtype.name.split("_")[0])
assign_placeholder = tf.placeholder(tf_dtype, shape=value.shape)
assign_op = x.assign(assign_placeholder)
get_session().run(assign_op, feed_dict={assign_placeholder: value})