priscacheese:

Is this different from what you would expect?


My mistake, I assumed that len(dataloader) denotes the number of items in the underlying dataset. If len(dataloader) denotes the number of batches delivered by the dataloader then this computation is correct, except in the case—which you pointed out—when batches have different sizes.