:mod:`heat.utils.data.mnist` ============================ .. py:module:: heat.utils.data.mnist .. autoapi-nested-parse:: File for the MNIST dataset definition in heat Module Contents --------------- .. py:class:: MNISTDataset(root: str, train: bool = True, transform: Callable = None, target_transform: Callable = None, download: bool = True, split: int = 0, ishuffle: bool = False, test_set: bool = False) Bases: :class:`torchvision.datasets.MNIST` Dataset wrapper for `torchvision.datasets.MNIST `_. This implements all of the required functions mentioned in :class:`heat.utils.data.Dataset`. The ``__getitem__`` and ``__len__`` functions are inherited from `torchvision.datasets.MNIST `_. :param root: Directory containing the MNIST dataset :type root: str :param train: If the data is the training dataset or not, default is True :type train: bool, optional :param transform: Transform to be applied to the data dataset in the ``__getitem__`` function, default is ``None`` :type transform: Callable, optional :param target_transform: Transform to be applied to the target dataset in the ``__getitem__`` function, default is ``None`` :type target_transform: Callable, optional :param download: If the data does not exist in the directory, download it if True (default) :type download: bool, optional :param split: On which access to split the data when it is loaded into a ``DNDarray`` :type split: int, optional :param ishuffle: Flag indicating whether to use non-blocking communications for shuffling the data between epochs Note: if True, the ``Ishuffle()`` function must be defined within the class Default: ``False`` :type ishuffle: bool, optional :param test_set: If this dataset is the testing set then keep all of the data local Default: ``False`` :type test_set: bool, optional :ivar htdata: full data :vartype htdata: DNDarray :ivar httargets: full target data :vartype httargets: DNDarray :ivar comm: heat communicator for sending data between processes :vartype comm: communication.MPICommunicator :ivar _cut_slice: slice to remove the last element if all are not equal in length :vartype _cut_slice: slice :ivar lcl_half: integer value of half of the data on the process :vartype lcl_half: int :ivar data: the local data on a process :vartype data: torch.Tensor :ivar targets: the local targets on a process :vartype targets: torch.Tensor :ivar ishuffle: flag indicating if non-blocking communications are used for shuffling the data between epochs :vartype ishuffle: bool :ivar test_set: if this dataset is the testing set then keep all of the data local :vartype test_set: bool .. rubric:: Notes For other attributes see `torchvision.datasets.MNIST `_. .. attribute:: test_set :annotation: = False .. attribute:: partial_dataset :annotation: = False .. attribute:: comm .. attribute:: htdata .. attribute:: httargets .. attribute:: ishuffle :annotation: = False .. role:: raw-html(raw) :format: html .. method:: Shuffle() Uses the :func:`datatools.dataset_shuffle` function to shuffle the data between the processes .. method:: Ishuffle() Uses the :func:`datatools.dataset_ishuffle` function to shuffle the data between the processes