Temporarily don't try to expand tf.Variable.
Temporarily don't try to expand tf.Variable.

We are planning to make tf.Variable a subclass of CompositeTensor. To reduce the risk of rollback, in phase one, tf.Variable will become a CompositeTensor but don't get expanded to dt_resource tensors with expand_composites=True. In phase two, we will allow tf.Variables to be expanded into dt_resource tensors.

The CL will prevent infinite recursion in phase one. After phase one is landed, this CL will be reverted in phase two.

Note: This CL shouldn't change existing behavior because tf.Variable is currently not a CompositeTensor or ExtensionType.
PiperOrigin-RevId: 474615037

keras-team/keras,keras-team/keras