class_docstr: Reads and distributes a sub-batch on a host.
class_docstr_tok: ["Reads","and","distributes","a","sub-batch","on","a","host","."]
code: def __init__(
      self,
      sub_batch_ds_creator,
      host_id,
      all_sub_batch_pnums,
      simd_mesh_impl,
      mtf_input_shapes,
      external_worker,
      global_batch,
  ):
      self._host_id = host_id
      self._all_sub_batch_pnums = all_sub_batch_pnums
      self._simd_mesh_impl = simd_mesh_impl
      self._mtf_input_shapes = mtf_input_shapes
      self._external_worker = external_worker
      self._global_batch = global_batch
  
      self._validate_args()
  
      with ops.device(
          _host_id_to_tf_device(self._host_id, self._external_worker)
      ):
          self._ds_iterator = (
              sub_batch_ds_creator().make_initializable_iterator()
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import threading
  import time
  import numpy
  from six.moves import range
  from six.moves import zip
  import tensorflow.compat.v1
  from tensorflow.python.framework import ops
  from tensorflow.python.tpu import tpu_feed
label_desc: Use image node_id 1 to create a new SubBatchSlicer object from inherited base classes: object with example: obj = SubBatchSlicer(sub_batch_ds_creator, host_id, all_sub_batch_pnums, simd_mesh_impl, mtf_input_shapes, external_worker, global_batch)