Removed set_shape overrides from ResourceVariable subclasses.
These are essentially no-ops and allow for reads returning tensors inconsistent
with variable shape:
>>> import tensorflow as tf
>>> tf.enable_eager_execution()
>>> v = tf.Variable(0)
>>> t = v.assign(42)
>>> t.set_shape((100500, ))
>>> t.shape
(100500, )
>>> tf.convert_to_tensor(t)
<tf.Tensor: id=9, shape=(), dtype=int32, numpy=42>
PiperOrigin-RevId: 227903155
Loading
Please sign in to comment