message: [tf.data] Throw an error when trying to use `tf.data.Dataset.__iter__()` in graph-mode outside of tf.function.
diff: @@ -282,9 +282,14 @@ class DatasetV2(tracking_base.Trackable, composite_tensor.CompositeTensor):
  An `Iterator` over the elements of this dataset.
  Raises:
  - RuntimeError: If eager execution is not enabled.
  + RuntimeError: If not inside of tf.function and not executing eagerly.
  """
  + if (context.executing_eagerly()
  + or ops.get_default_graph()._building_function): # pylint: disable=protected-access
  return iterator_ops.IteratorV2(self)
  + else:
  + raise RuntimeError("__iter__() is only supported inside of tf.function "
  + "or when eager execution is enabled.")
  @abc.abstractproperty
  def _element_structure(self):
  