Ë
    BÆVhó
  ã                   óL   — d Z ddlmZ ddlmZ ddlmZ  edg ¬«      d„ «       Zy)	z.Python API for random indexing into a dataset.é    )Ú	structure)Úgen_experimental_dataset_ops)Ú	tf_exportzdata.experimental.at)Úv1c                 óø   — t        j                  | j                  t        j                  | j
                  |t        j                  | j                  «      t        j                  | j                  «      ¬«      «      S )a¥  Returns the element at a specific index in a datasest.

  Currently, random access is supported for the following tf.data operations:

     - `tf.data.Dataset.from_tensor_slices`,
     - `tf.data.Dataset.from_tensors`,
     - `tf.data.Dataset.shuffle`,
     - `tf.data.Dataset.batch`,
     - `tf.data.Dataset.shard`,
     - `tf.data.Dataset.map`,
     - `tf.data.Dataset.range`,
     - `tf.data.Dataset.zip`,
     - `tf.data.Dataset.skip`,
     - `tf.data.Dataset.repeat`,
     - `tf.data.Dataset.list_files`,
     - `tf.data.Dataset.SSTableDataset`,
     - `tf.data.Dataset.concatenate`,
     - `tf.data.Dataset.enumerate`,
     - `tf.data.Dataset.parallel_map`,
     - `tf.data.Dataset.prefetch`,
     - `tf.data.Dataset.take`,
     - `tf.data.Dataset.cache` (in-memory only)

     Users can use the cache operation to enable random access for any dataset,
     even one comprised of transformations which are not on this list.
     E.g., to get the third element of a TFDS dataset:

       ```python
       ds = tfds.load("mnist", split="train").cache()
       elem = tf.data.Dataset.experimental.at(ds, 3)
       ```

  Args:
    dataset: A `tf.data.Dataset` to determine whether it supports random access.
    index: The index at which to fetch the element.

  Returns:
      A (nested) structure of values matching `tf.data.Dataset.element_spec`.

   Raises:
     UnimplementedError: If random access is not yet supported for a dataset.
  )Úoutput_typesÚoutput_shapes)r   Úfrom_tensor_listÚelement_specr   Úget_element_at_indexÚ_variant_tensorÚget_flat_tensor_typesÚget_flat_tensor_shapes)ÚdatasetÚindexs     úe/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/data/experimental/ops/random_access.pyÚatr      sf   € ôZ 
×	#Ñ	#Ø×ÑÜ"×7Ñ7Ø
×
!Ñ
!Ø
Ü ×6Ñ6°w×7KÑ7KÓLÜ!×8Ñ8¸×9MÑ9MÓNô	Pó
Qð Qó    N)Ú__doc__Útensorflow.python.data.utilr   Útensorflow.python.opsr   Ú tensorflow.python.util.tf_exportr   r   © r   r   ú<module>r      s1   ðñ 5å 1Ý >Ý 6ñ Ð! bÔ)ñ2Qó *ñ2Qr   