class_docstr: PartitionedFunction will translate call to cached Function call
class_docstr_tok: ["PartitionedFunction","will","translate","call","to","cached","Function","call"]
code: def __call__(self, start, stop):
      while self._length is None:
          # if stop is not None then resolved partitions have to cover stop
          # if stop is None then all partitions has to be resolved
          if stop is not None:
              if stop <= sum(e.shape[0] for e in self._partitions):
                  break
          # resolve one step
          partition = self._function()
          if partition.shape[0] == 0:
              self._length = sum(e.shape[0] for e in self._partitions)
          else:
              self._partitions.append(partition)
          partitions_indices = (
              tf.cumsum([e.shape[0] for e in self._partitions])
              .numpy()
              .tolist()
          )
          self._partitions_start = list([0] + partitions_indices[:-1])
          self._partitions_stop = partitions_indices
      length = self._partitions_stop[-1]
      index = slice(start, stop)
      start, stop, _ = index.indices(length)
      if start >= length:
          raise IndexError("index %s is out of range" % index)
      indices_start = tf.math.maximum(self._partitions_start, start)
      indices_stop = tf.math.minimum(self._partitions_stop, stop)
      indices_hit = tf.math.less(indices_start, indices_stop)
      indices = tf.squeeze(tf.compat.v2.where(indices_hit), [1])
      return self._partitions_read(indices_start, indices_stop, indices)
  
imports: import tensorflow
label_desc: Use image node_id 2 for calling the _IOTensorIterablePartitionedFunction obj's underlying member method code with example usage: obj.__call__(start, stop) and returns: self