Oh, that information was very useful, I didn’t know how to check it out at all.
So supposing that I am obtaining the samples one by one with an iterator:

for i in range(loops):
try:
inputs, targets = next(dataloader_iterator)
except StopIteration:
dataloader_iterator = iter(dataloader)
inputs, targets = next(dataloader_iterator)
      inputs, targets = inputs.to(device), targets.to(device)


Given a single sample per iteration [target(i) and inputs(i)], which one is the fastest way to build a batch with these x20 inputs(i) and x20 targets(i)? This is my last step but I am not able to create it in an efficient way
Thank you very much