class_docstr: Reads and distributes a sub-batch on a host.
class_docstr_tok: ["Reads","and","distributes","a","sub-batch","on","a","host","."]
docstr: Slice input_tensor according to mtf_input_shape and pnum.
docstr_tok: ["Slice","input_tensor","according","to","mtf_input_shape","and","pnum","."]
code: def _slice_tensor(self, input_tensor, mtf_input_shape, pnum):
      """Slice input_tensor according to mtf_input_shape and pnum."""
      s_begin = self._simd_mesh_impl.slice_begin(mtf_input_shape, pnum)
      if not self._global_batch:
          # Always slice from 0 in the first dimension (batch dimension), since
          # input_tensor a sub-batch tensor.
          s_begin[0] = 0
      if tuple(s_begin) in self._slice_dict:
          return self._slice_dict[tuple(s_begin)]
  
      s_shape = self._simd_mesh_impl.slice_shape(mtf_input_shape)
      input_slice = tf.slice(input_tensor, s_begin, s_shape)
  
      self._slice_dict[tuple(s_begin)] = input_slice
      return input_slice
  
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 6 for calling the SubBatchSlicer obj's underlying member method code with example usage: obj._slice_tensor(input_tensor, mtf_input_shape, pnum) and returns: input_slice, self