Ë
    2ÆVh½  ã                   ó   —  G d „ d«      Z y)c                   ót   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zed„ «       Z	ed„ «       Z
ed„ «       Zed	„ «       Zd
„ Zd„ Zy)ÚDataAdapterzþBase class for input data adapters.

    The purpose of a DataAdapter is to provide a unified interface to
    iterate over input data provided in a variety of formats -- such as
    NumPy arrays, tf.Tensors, tf.data.Datasets, Keras PyDatasets, etc.
    c                 ó   — t         ‚)zˆGet a Python iterable for the `DataAdapter`, that yields NumPy
        arrays.

        Returns:
            A Python iterator.
        ©ÚNotImplementedError©Úselfs    ú]/home/dcms/DCMS/lib/python3.12/site-packages/keras/src/trainers/data_adapters/data_adapter.pyÚget_numpy_iteratorzDataAdapter.get_numpy_iterator	   ó
   € ô "Ð!ó    c                 ó   — t         ‚)a  Get a `tf.data.Dataset` instance for the DataAdapter.

        Note that the dataset returned does not repeat for epoch, so caller
        might need to create new iterator for the same dataset at the beginning
        of the epoch. This behavior might change in the future.

        Returns:
            A `tf.data.Dataset`. Caller might use the dataset in different
            context, e.g. iter(dataset) in eager to get the value directly, or
            in graph mode, provide the iterator tensor to Keras model function.
        r   r   s    r	   Úget_tf_datasetzDataAdapter.get_tf_dataset   s
   € ô "Ð!r   c                 ó   — t         ‚)zÊGet a Python iterable for the `DataAdapter`, that yields arrays that
        that can be fed to JAX. NumPy arrays are preferred for performance.

        Returns:
            A Python iterator.
        r   r   s    r	   Úget_jax_iteratorzDataAdapter.get_jax_iterator    r   r   c                 ó   — t         ‚)zlGet a Torch `DataLoader` for the `DataAdapter`.

        Returns:
            A Torch `DataLoader`.
        r   r   s    r	   Úget_torch_dataloaderz DataAdapter.get_torch_dataloader)   ó
   € ô "Ð!r   c                 ó   — t         ‚)aP  Return the size (number of batches) for the dataset created.

        For certain type of the data input, the number of batches is known, eg
        for Numpy data, the size is same as (number_of_element / batch_size).
        Whereas for dataset or python generator, the size is unknown since it
        may or may not have an end state.

        Returns:
            int, the number of batches for the dataset, or None if it is
            unknown.  The caller could use this to control the loop of training,
            show progress bar, or handle unexpected StopIteration error.
        r   r   s    r	   Únum_batcheszDataAdapter.num_batches1   s
   € ô "Ð!r   c                 ó   — t         ‚)aL  Return the batch size of the dataset created.

        For certain type of the data input, the batch size is known, and even
        required, like numpy array. Whereas for dataset, the batch is unknown
        unless we take a peek.

        Returns:
          int, the batch size of the dataset, or None if it is unknown.
        r   r   s    r	   Ú
batch_sizezDataAdapter.batch_sizeA   s
   € ô "Ð!r   c                 ó   — t         ‚)z1Whether the dataset has partial batch at the end.r   r   s    r	   Úhas_partial_batchzDataAdapter.has_partial_batchN   s
   € ô "Ð!r   c                 ó   — t         ‚)zˆThe size of the final partial batch for dataset.

        Will return None if has_partial_batch is False or batch_size is None.
        r   r   s    r	   Úpartial_batch_sizezDataAdapter.partial_batch_sizeS   r   r   c                  ó   — y)z A hook called before each epoch.N© r   s    r	   Úon_epoch_beginzDataAdapter.on_epoch_begin[   ó   € àr   c                  ó   — y)zA hook called after each epoch.Nr   r   s    r	   Úon_epoch_endzDataAdapter.on_epoch_end_   r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r   r   Úpropertyr   r   r   r   r   r!   r   r   r	   r   r      su   „ ñò"ò"ò"ò"ð ñ"ó ð"ð ñ
"ó ð
"ð ñ"ó ð"ð ñ"ó ð"òór   r   N)r   r   r   r	   ú<module>r'      s   ð÷`ò `r   