class_docstr: An iterator over `tf.distribute.DistributedDataset`.
  
  `tf.distribute.DistributedIterator` is the primary mechanism for enumerating
  elements of a `tf.distribute.DistributedDataset`. It supports the Python
  Iterator protocol, which means it can be iterated over using a for-loop or by
  fetching individual elements explicitly via `get_next()`.
  
  You can create a `tf.distribute.DistributedIterator` by calling `iter` on
  a `tf.distribute.DistributedDataset` or creating a python loop over a
  `tf.distribute.DistributedDataset`.
  
  Visit the [tutorial](https://www.tensorflow.org/tutorials/distribute/input)
  on distributed input for more examples and caveats.
class_docstr_tok: ["An","iterator","over","`","tf.distribute.DistributedDataset","`",".","`","tf.distribute.DistributedIterator","`","is","the","primary","mechanism","for","enumerating","elements","of","a","`","tf.distribute.DistributedDataset","`",".","It","supports","the","Python","Iterator","protocol",",","which","means","it","can","be","iterated","over","using","a","for-loop","or","by","fetching","individual","elements","explicitly","via","`","get_next","(",")","`",".","You","can","create","a","`","tf.distribute.DistributedIterator","`","by","calling","`","iter","`","on","a","`","tf.distribute.DistributedDataset","`","or","creating","a","python","loop","over","a","`","tf.distribute.DistributedDataset","`",".","Visit","the","[","tutorial","]","(","https",":","\/\/www.tensorflow.org\/tutorials\/distribute\/input",")","on","distributed","input","for","more","examples","and","caveats","."]
docstr: Returns the next input from the iterator for all replicas.
  
  Example use:
  
  >>> strategy = tf.distribute.MirroredStrategy(["GPU:0", "GPU:1"])
  >>> dataset = tf.data.Dataset.range(100).batch(2)
  >>> dist_dataset = strategy.experimental_distribute_dataset(dataset)
  >>> dist_dataset_iterator = iter(dist_dataset)
  >>> @tf.function
  ... def one_step(input):
  ...   return input
  >>> step_num = 5
  >>> for _ in range(step_num):
  ...   strategy.run(one_step, args=(dist_dataset_iterator.get_next(),))
  >>> strategy.experimental_local_results(dist_dataset_iterator.get_next())
  (<tf.Tensor: shape=(1,), dtype=int64, numpy=array([10])>,
   <tf.Tensor: shape=(1,), dtype=int64, numpy=array([11])>)
  
  Returns:
    A single `tf.Tensor` or a `tf.distribute.DistributedValues` which contains
    the next input for all replicas.
  
  Raises:
    `tf.errors.OutOfRangeError`: If the end of the iterator has been reached.
docstr_tok: ["Returns","the","next","input","from","the","iterator","for","all","replicas",".","Example","use",":",">",">",">","strategy","=","tf.distribute.MirroredStrategy","(","[","``","GPU:0","''",",","``","GPU:1","''","]",")",">",">",">","dataset","=","tf.data.Dataset.range","(","100",")",".batch","(","2",")",">",">",">","dist_dataset","=","strategy.experimental_distribute_dataset","(","dataset",")",">",">",">","dist_dataset_iterator","=","iter","(","dist_dataset",")",">",">",">","@","tf.function","...","def","one_step","(","input",")",":","...","return","input",">",">",">","step_num","=","5",">",">",">","for","_","in","range","(","step_num",")",":","...","strategy.run","(","one_step",",","args=","(","dist_dataset_iterator.get_next","(",")",",",")",")",">",">",">","strategy.experimental_local_results","(","dist_dataset_iterator.get_next","(",")",")","(","<","tf.Tensor",":","shape=","(","1",",",")",",","dtype=int64",",","numpy=array","(","[","10","]",")",">",",","<","tf.Tensor",":","shape=","(","1",",",")",",","dtype=int64",",","numpy=array","(","[","11","]",")",">",")","Returns",":","A","single","`","tf.Tensor","`","or","a","`","tf.distribute.DistributedValues","`","which","contains","the","next","input","for","all","replicas",".","Raises",":","`","tf.errors.OutOfRangeError","`",":","If","the","end","of","the","iterator","has","been","reached","."]
code: def get_next(self):
      """Returns the next input from the iterator for all replicas.
  
      Example use:
  
      >>> strategy = tf.distribute.MirroredStrategy(["GPU:0", "GPU:1"])
      >>> dataset = tf.data.Dataset.range(100).batch(2)
      >>> dist_dataset = strategy.experimental_distribute_dataset(dataset)
      >>> dist_dataset_iterator = iter(dist_dataset)
      >>> @tf.function
      ... def one_step(input):
      ...   return input
      >>> step_num = 5
      >>> for _ in range(step_num):
      ...   strategy.run(one_step, args=(dist_dataset_iterator.get_next(),))
      >>> strategy.experimental_local_results(dist_dataset_iterator.get_next())
      (<tf.Tensor: shape=(1,), dtype=int64, numpy=array([10])>,
       <tf.Tensor: shape=(1,), dtype=int64, numpy=array([11])>)
  
      Returns:
        A single `tf.Tensor` or a `tf.distribute.DistributedValues` which contains
        the next input for all replicas.
  
      Raises:
        `tf.errors.OutOfRangeError`: If the end of the iterator has been reached.
      """
      raise NotImplementedError(
          "DistributedIterator.get_next() must be implemented in descendants."
      )
  
imports: from tensorflow.python.util.tf_export import tf_export
  from tensorflow.tools.docs import doc_controls
label_desc: Use image node_id 1 for calling the DistributedIteratorInterface obj's underlying member method code with example usage: obj.get_next() without return types