message: Make `__repr__` more reliable, if the value is not available.
diff: @@ -441,9 +441,14 @@ class BaseResourceVariable(variables.VariableV1):
  def __repr__(self):
  if context.executing_eagerly() and not self._in_graph_mode:
  + # If we cannot read the value for any reason, still produce a __repr__.
  + try:
  + value_text = ops.numpy_text(self.read_value(), is_repr=True)
  + except: # pylint: disable=bare-except
  + value_text = "<unavailable>"
  +
  return "<tf.Variable '%s' shape=%s dtype=%s, numpy=%s>" % (
  - self.name, self.get_shape(), self.dtype.name,
  - ops.numpy_text(self.read_value(), is_repr=True))
  + self.name, self.get_shape(), self.dtype.name, value_text)
  else:
  return "<tf.Variable '%s' shape=%s dtype=%s>" % (
  self.name, self.get_shape(), self.dtype.name)
  