class_docstr: An iterator over multiple devices.
  
  The multi-device iterator resource created through `OwnedMultiDeviceIterator`
  is owned by the Python object and the life time of the underlying resource is
  tied to the life time of the `OwnedMultiDeviceIterator` object. This makes
  `OwnedMultiDeviceIterator` appropriate for use in eager mode and inside of
  tf.functions.
class_docstr_tok: ["An","iterator","over","multiple","devices",".","The","multi-device","iterator","resource","created","through","`","OwnedMultiDeviceIterator","`","is","owned","by","the","Python","object","and","the","life","time","of","the","underlying","resource","is","tied","to","the","life","time","of","the","`","OwnedMultiDeviceIterator","`","object",".","This","makes","`","OwnedMultiDeviceIterator","`","appropriate","for","use","in","eager","mode","and","inside","of","tf.functions","."]
docstr: Returns the next element given a `device`, else returns all in a list.
code: def get_next(self, device=None):
      """Returns the next element given a `device`, else returns all in a list."""
      if device is not None:
          index = self._devices.index(device)
          return self._device_iterators[index].get_next()
  
      result = []
      for i, device in enumerate(self._devices):
          with ops.device(device):
              result.append(self._device_iterators[i].get_next())
      return result
  
imports: from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import iterator_ops
  from tensorflow.python.data.ops import options
  from tensorflow.python.data.ops import prefetch_op
  from tensorflow.python.data.util import structure
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import composite_tensor
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import type_spec
  from tensorflow.python.framework import type_utils
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import functional_ops
  from tensorflow.python.ops import gen_dataset_ops
  from tensorflow.python.ops import resource_variable_ops
label_desc: Use image node_id 2 for calling the OwnedMultiDeviceIterator obj's underlying member method code with example usage: obj.get_next(device) and returns: result, self