Last batch might be of different sizes so loss_meter.add(loss) is not correct, should be loss_meter.add(loss*bs, bs).
Last batch might be of different sizes so loss_meter.add(loss) is not correct, should be loss_meter.add(loss*bs, bs).