In Pytorch, when using torchvision MNIST dataset, we can get a digit as follow :
   import torchvision
    import torchvision.transforms as transforms
    from torch.utils.data import DataLoader, Dataset, TensorDataset
    
    tsfm = transforms.Compose([transforms.Resize((16, 16)),
                               transforms.ToTensor(),
                               transforms.Normalize((0.1307,), (0.3081,))])
    
    mnist_ds = torchvision.datasets.MNIST(root='../../../_data/mnist',train=True,
                                    download=True, transform=tsfm)
    
    
    digit_12 = mnist_ds[12]

Though it is possible to slice on most datasets, we can not slice on this one:
digit_12_to_14 = mnist_ds[12:15]
will return

ValueError: Too many dimensions: 3 > 2.


This is due to a Image.fromarray() in the getItem()
Is it possible to use MNIST dataset without using a Dataloader ? How ?
PS: The reason why I would like to avoid using Dataloader is that sending batches one at a time to the GPU slow down the training. I prefer to send to the GPU the whole data just one time. For this I need to have access to the whole TRANSFORMED dataset.