Hi all!!
I am new in torch. My task is to train a model by using batch samples from the dataset. I can not use loops for collecting samples into the batch and torch.utils.data.DataLoader is also prohibited. I can only iterate over the batches in the dataset. So my question is, how to create these batches in the dataset with the restrictions that I mentioned above.

123.png1029×135 8.83 KB

This is how I did before where get_batches is a special function for collecting samples into the batch and I want to replace it.