Class QMnistDataset

Inheritance Relationships

Base Type

Class Documentation

class QMnistDataset : public mindspore::dataset::Dataset

A source dataset that reads and parses QMNIST dataset.

Public Functions

QMnistDataset(const std::vector<char> &dataset_dir, const std::vector<char> &usage, bool compat, const std::shared_ptr<Sampler> &sampler, const std::shared_ptr<DatasetCache> &cache)

Constructor of QMnistDataset.

Parameters
  • dataset_dir[in] Path to the root directory that contains the dataset.

  • usage[in] Usage of QMNIST, can be “train”, “test”, “test10k”, “test50k”, “nist” or “all”.

  • compat[in] Whether the label for each example is class number (compat=true) or the full QMNIST information (compat=false).

  • sampler[in] Shared pointer to a sampler object used to choose samples from the dataset. If sampler is not given, a RandomSampler will be used to randomly iterate the entire dataset.

  • cache[in] Tensor cache to use.

QMnistDataset(const std::vector<char> &dataset_dir, const std::vector<char> &usage, bool compat, const Sampler *sampler, const std::shared_ptr<DatasetCache> &cache)

Constructor of QMnistDataset.

Parameters
  • dataset_dir[in] Path to the root directory that contains the dataset.

  • usage[in] Usage of QMNIST, can be “train”, “test”, “test10k”, “test50k”, “nist” or “all”.

  • compat[in] Whether the label for each example is class number (compat=true) or the full QMNIST information (compat=false).

  • sampler[in] Raw pointer to a sampler object used to choose samples from the dataset.

  • cache[in] Tensor cache to use.

QMnistDataset(const std::vector<char> &dataset_dir, const std::vector<char> &usage, bool compat, const std::reference_wrapper<Sampler> &sampler, const std::shared_ptr<DatasetCache> &cache)

Constructor of QMnistDataset.

Parameters
  • dataset_dir[in] Path to the root directory that contains the dataset.

  • usage[in] Usage of QMNIST, can be “train”, “test”, “test10k”, “test50k”, “nist” or “all”.

  • compat[in] Whether the label for each example is class number (compat=true) or the full QMNIST information (compat=false).

  • sampler[in] Sampler object used to choose samples from the dataset.

  • cache[in] Tensor cache to use.

~QMnistDataset() override = default

Destructor of QMnistDataset.