Solved by justusschock in post #4 
              
              
                This does not work with the default dataloader but in general you could handle the loading by yourself and simply add a batch dimension to your data and use torch.cat to stack them to a batch: 
batch_elements = []

for i in range(curr_batch_size):
    # generate some sample data
    tmp = torch.rand…