Table of Contents
Shortcuts

# QMNIST

class torchvision.datasets.QMNIST(root: str, what: Optional[str] = None, compat: bool = True, train: bool = True, **kwargs: Any)

  QMNIST Dataset.

  Parameters:

    - root (string) – Root directory of dataset whose `raw` subdir contains binary files of the datasets.

    - what (string,optional) – Can be ‘train’, ‘test’, ‘test10k’, ‘test50k’, or ‘nist’ for respectively the mnist compatible training set, the 60k qmnist testing set, the 10k qmnist examples that match the mnist testing set, the 50k remaining qmnist testing examples, or all the nist digits. The default is to select ‘train’ or ‘test’ according to the compatibility argument ‘train’.

    - compat (bool,optional) – A boolean that says whether the target for each example is class number (for compatibility with the MNIST dataloader) or a torch vector containing the full qmnist information. Default=True.

    - download (bool, optional) – If True, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again.

    - transform (callable, optional) – A function/transform that takes in an PIL image and returns a transformed version. E.g, `transforms.RandomCrop`

    - target_transform (callable, optional) – A function/transform that takes in the target and transforms it.

    - train (bool,optional,compatibility) – When argument ‘what’ is not specified, this boolean decides whether to load the training set or the testing set. Default: True.

  Special-members:

  __getitem__(index: int) → Tuple[Any, Any]
    Parameters:

      index (int) – Index

    Returns:

      (image, target) where target is index of the target class.

    Return type:

      tuple

## Docs

Access comprehensive developer documentation for PyTorch

View Docs

## Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

## Resources

Find development resources and get your questions answered

View Resources

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.