message: Handle indexed slice empty shapes in IndexedSlices gradients correctly.
diff: @@ -625,12 +625,13 @@ def _num_elements(grad):
  """The number of elements in the `grad` tensor."""
  if isinstance(grad, ops.Tensor):
  shape_tuple = grad._shape_tuple() # pylint: disable=protected-access
  + elif isinstance(grad, ops.IndexedSlices):
  + shape_tuple = grad.values._shape_tuple() # pylint: disable=protected-access
  + else:
  + raise ValueError("`grad` not a Tensor or IndexedSlices.")
  if shape_tuple is None or None in shape_tuple:
  return 0
  return functools.reduce(operator.mul, shape_tuple, 1)
  - if isinstance(grad, ops.IndexedSlices):
  - return functools.reduce(operator.mul, grad.values._shape_tuple(), 1) # pylint: disable=protected-access
  - raise ValueError("`grad` not a Tensor or IndexedSlices.")
  def _fast_fill(value, shape, dtype):
  