Why TensorDataset devide the data to minibatches? For example, when putting in it 2D array, instead of yielding 2D tensors as batches, it sets the required batches to be minibatches, and its actual "batch" size is a list of length 1. For example, why in this example the batch size is 1 and not 3? from torch.utils.data import TensorDataset data = torch.randint(0, 100, (20, 3), dtype=torch.int32) tensor_dataset = TensorDataset(data) print('len(tensor_dataset)', len(tensor_dataset)) # output: 20 for batch in tensor_dataset: print('type(batch)', type(batch)) ## output: tuple print('len(batch)', len(batch)) ## output: 1 <<<******** Why not 3? ******** for minibatch in batch: print('type(minibatch)', type(minibatch)) ## output: tensor print('len(minibatch)', len(minibatch)) ## output: 3 break break Is there built-in solution for this, or it must be handled manually by unpacking the batches to minibatches in the dataloader loop? Continue reading...