message: [tf.data] Avoid printing a spurious warning for `tf.compat.v1.data.make_one_shot_iterator` and `tf.compat.v1.data.make_initializable_iterator`.
diff: @@ -1364,6 +1364,9 @@ class DatasetV1(DatasetV2):
  Returns:
  An `Iterator` over the elements of this dataset.
  """
  + return self._make_one_shot_iterator()
  +
  + def _make_one_shot_iterator(self): # pylint: disable=missing-docstring
  if context.executing_eagerly():
  return iterator_ops.EagerIterator(self)
  @@ -1441,6 +1444,10 @@ class DatasetV1(DatasetV2):
  Raises:
  RuntimeError: If eager execution is enabled.
  """
  +
  + return self._make_initializable_iterator(shared_name)
  +
  + def _make_initializable_iterator(self, shared_name=None): # pylint: disable=missing-docstring
  if context.executing_eagerly():
  raise RuntimeError(
  "dataset.make_initializable_iterator is not supported when eager "
  @@ -1725,11 +1732,11 @@ def make_one_shot_iterator(dataset):
  A `tf.data.Iterator` over the elements of this dataset.
  """
  try:
  - # Call the defined `make_one_shot_iterator()` if there is one, because some
  + # Call the defined `_make_one_shot_iterator()` if there is one, because some
  # datasets (e.g. for prefetching) override its behavior.
  - return dataset.make_one_shot_iterator()
  + return dataset._make_one_shot_iterator() # pylint: disable=protected-access
  except AttributeError:
  - return DatasetV1Adapter(dataset).make_one_shot_iterator()
  + return DatasetV1Adapter(dataset)._make_one_shot_iterator() # pylint: disable=protected-access
  @tf_export(v1=["data.make_initializable_iterator"])
  @@ -1759,11 +1766,11 @@ def make_initializable_iterator(dataset, shared_name=None):
  RuntimeError: If eager execution is enabled.
  """
  try:
  - # Call the defined `make_initializable_iterator()` if there is one, because
  + # Call the defined `_make_initializable_iterator()` if there is one, because
  # some datasets (e.g. for prefetching) override its behavior.
  - return dataset.make_initializable_iterator(shared_name)
  + return dataset._make_initializable_iterator(shared_name) # pylint: disable=protected-access
  except AttributeError:
  - return DatasetV1Adapter(dataset).make_initializable_iterator(shared_name)
  + return DatasetV1Adapter(dataset)._make_initializable_iterator(shared_name) # pylint: disable=protected-access
  @tf_export("data.Options")
  