Batch size can’t change on it’s own. The only reasonable suggestion here is that remaining number of elements from the pool during the last batch is less than 50: if you have 146 examples your last batch’ size should be 46. Since it’s 42, you’re missing something with dataloader or your object’s shape.