How to get one sample of dataset to train and to test

dataloader = datasets.CIFAR10
trainset = dataloader(root='./data', train=True, download=True, 

Now I want to get one sample of trainset to train for debugging my code ,how to write the code?

Based on your code, you should be able to get the first element by running this:


You may find the examples on this page helpful.

Thanks a lot, maybe, subset_indices)