Smaller last batch skews Train/EvalResult
🚀 Feature
Supported weighted average for Result
Motivation
The last batch of dataloader is usually smaller than a regular batch. Hence simply average the statistic of all batches will skew the epoch statistic.
For example
result.log('accuracy', 0.7) # batch size 256
result.log('accuracy', 0.8) # batch size 256
result.log('accuracy', 0.9) # batch size 10 (last batch)

Wrong epoch accuracy = (0.7 + 0.8 + 0.9) / 3
Correct epoch accuracy = (256 * 0.7 + 256 * 0.8 + 10 * 0.9) / ( 256 + 256 + 10)
Pitch
Support input for weight, or batch size in Result
result.log('accuracy', 0.7, batch_size)  
Alternatives
I don't see any alternatives other than switch back the the old way of using training/validation_epoch_end and do the weighted average manually there.
Additional context