class_docstr: TensorIOTensor
  
  A `TensorIOTensor` is an `IOTensor` from a regular `Tensor`.
class_docstr_tok: ["TensorIOTensor","A","`","TensorIOTensor","`","is","an","`","IOTensor","`","from","a","regular","`","Tensor","`","."]
code: def __init__(self, tensor, internal=False):
      tensor = tf.convert_to_tensor(tensor)
  
      class _Function:
          """_Function"""
  
          def __init__(self, tensor):
              self._tensor = tensor
              self._base_start = [0 for _ in tensor.shape.as_list()]
              self._base_size = [-1 for _ in tensor.shape.as_list()]
              self._length = tensor.shape[0]
  
          def __call__(self, start, stop):
              start, stop, _ = slice(start, stop).indices(self._length)
              if start >= self._length:
                  raise IndexError(
                      "index %s is out of range" % slice(start, stop)
                  )
              slice_start = self._base_start
              slice_size = self._base_size
              slice_start[0] = start
              slice_size[0] = stop - start
              return tf.slice(self._tensor, slice_start, slice_size)
  
          @property
          def length(self):
              return self._length
  
      self._tensor = tensor
  
      super().__init__(
          tf.TensorSpec(tensor.shape, tensor.dtype),
          _Function(tensor),
          internal=internal,
      )
  
imports: import tensorflow
label_desc: Use image node_id 1 to create a new TensorIOTensor object from inherited base classes: BaseIOTensor with example: obj = TensorIOTensor(tensor, internal)