message: Remove code in default_gradient that returns float32 if resource handle_data is not set since that should never happen.
diff: @@ -29,10 +29,8 @@ def get_zeros_dtype(t):
  handle_data = resource_variable_ops.get_eager_safe_handle_data(t)
  if (handle_data is None or not handle_data.is_set or
  len(handle_data.shape_and_type) != 1):
  - # TODO(srbs): Ideally we should raise an error here but returning float32
  - # for backwards compatibility.
  - return dtypes.float32
  - else:
  + raise ValueError("Internal error: Tried to take gradients (or similar) "
  + "of a variable without handle data:\n%s" % str(t))
  return handle_data.shape_and_type[0].dtype
  return t.dtype
  @@ -43,8 +41,8 @@ def shape_and_dtype(t):
  handle_data = resource_variable_ops.get_eager_safe_handle_data(t)
  if (handle_data is None or not handle_data.is_set or
  len(handle_data.shape_and_type) != 1):
  - return tensor_shape.TensorShape(None), dtypes.float32
  - else:
  + raise ValueError("Internal error: Tried to take gradients (or similar) "
  + "of a variable without handle data:\n%s" % str(t))
  shape_and_type = handle_data.shape_and_type[0]
  return (tensor_shape.TensorShape(shape_and_type.shape),
  dtypes.as_dtype(shape_and_type.dtype))
  