class_docstr: A `Dataset` of slices from a dataset element.
docstr: See `Dataset.from_tensor_slices` for details.
code: def __init__(self, element, is_files=False, name=None):
      """See `Dataset.from_tensor_slices` for details."""
      element = structure.normalize_element(element)
      batched_spec = structure.type_spec_from_value(element)
      self._tensors = structure.to_batched_tensor_list(
          batched_spec, element
      )
      if not self._tensors:
          raise ValueError(
              "Invalid `element`. `element` should not be empty."
          )
      self._structure = nest.map_structure(
          lambda component_spec: component_spec._unbatch(), batched_spec
      )  # pylint: disable=protected-access
      self._name = name
  
      batch_dim = tensor_shape.Dimension(
          tensor_shape.dimension_value(self._tensors[0].get_shape()[0])
      )
      for t in self._tensors[1:]:
          batch_dim.assert_is_compatible_with(
              tensor_shape.Dimension(
                  tensor_shape.dimension_value(t.get_shape()[0])
              )
          )
  
      variant_tensor = gen_dataset_ops.tensor_slice_dataset(
          self._tensors,
          output_shapes=structure.get_flat_tensor_shapes(
              self._structure
          ),
          is_files=is_files,
          metadata=self._metadata.SerializeToString(),
      )
      super().__init__(variant_tensor)
  
file_path: tensorflow/tensorflow/python/data/ops/from_tensor_slices_op.py
imports: from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.util import nest
  from tensorflow.python.data.util import structure
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.ops import gen_dataset_ops
label_desc: Use image node_id 1 to create a new _TensorSliceDataset object from inherited base classes: dataset_ops with example: obj = _TensorSliceDataset(element, is_files, name)