
    hh                     f    d Z ddlZddlZddlmZ ddlmZ ddlm	Z	 ddl
mZ  ed      d	d       Zy)
z-CIFAR100 small images classification dataset.    N)backend)
load_batch)get_file)keras_exportz!keras.datasets.cifar100.load_datac                    | dvrt        d|  d      d}d}|r6t        j                  j                  |      }t        j                  |d       t        ||dd|	      }t        j                  j                  |d
      }t        || dz         \  }}t        j                  j                  |d      }t        || dz         \  }}	t        j                  |t        |      df      }t        j                  |	t        |	      df      }	t        j                         dk(  r(|j                  dddd      }|j                  dddd      }||f||	ffS )a  Loads the CIFAR100 dataset.

    This is a dataset of 50,000 32x32 color training images and
    10,000 test images, labeled over 100 fine-grained classes that are
    grouped into 20 coarse-grained classes. See more info at the
    [CIFAR homepage](https://www.cs.toronto.edu/~kriz/cifar.html).

    Args:
      label_mode: one of "fine", "coarse". If it is "fine" the category labels
        are the fine-grained labels, if it is "coarse" the output labels are the
        coarse-grained superclasses.
      cache_dir: directory where to cache the dataset locally. When None,
        defaults to `~/.keras/datasets`.

    Returns:
      Tuple of NumPy arrays: `(x_train, y_train), (x_test, y_test)`.

    **x_train**: uint8 NumPy array of image data with shapes
      `(50000, 32, 32, 3)`, containing the training data. Pixel values range
      from 0 to 255.

    **y_train**: uint8 NumPy array of labels (integers in range 0-99)
      with shape `(50000, 1)` for the training data.

    **x_test**: uint8 NumPy array of image data with shapes
      `(10000, 32, 32, 3)`, containing the test data. Pixel values range
      from 0 to 255.

    **y_test**: uint8 NumPy array of labels (integers in range 0-99)
      with shape `(10000, 1)` for the test data.

    Example:

    ```python
    (x_train, y_train), (x_test, y_test) = keras.datasets.cifar100.load_data()
    assert x_train.shape == (50000, 32, 32, 3)
    assert x_test.shape == (10000, 32, 32, 3)
    assert y_train.shape == (50000, 1)
    assert y_test.shape == (10000, 1)
    ```
    )finecoarsezG`label_mode` must be one of `"fine"`, `"coarse"`. Received: label_mode=.zcifar-100-pythonz8https://www.cs.toronto.edu/~kriz/cifar-100-python.tar.gzT)exist_ok@85cd44d02ba6437773c5bbd22e183051d648de2e7d6b014e1ef29b855ba677a7)originuntar	file_hash	cache_dirtrain_labels)	label_keytest   channels_lastr         )
ValueErrorospath
expandusermakedirsr   joinr   npreshapelenr   image_data_format	transpose)

label_moder   dirnamer   r   fpathx_trainy_trainx_testy_tests
             \/var/www/html/dev/engine/venv/lib/python3.12/site-packages/tf_keras/src/datasets/cifar100.py	load_datar,      sO   V ++$$.<q2
 	

 !GGFGG&&y1	
I-ND GGLLw'E!%:	3IJGWGGLLv&Ei1GHNFFjj3w<"34GZZVa 01F  "o5##Aq!Q/!!!Q1-W///    )r   N)__doc__r   numpyr   tf_keras.srcr   tf_keras.src.datasets.cifarr   tf_keras.src.utils.data_utilsr    tensorflow.python.util.tf_exportr   r,    r-   r+   <module>r5      s:    4 	    2 2 : 12L0 3L0r-   