Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fix in the calculation of the validation loss (pytorch#427)
The last row of tokens in data_source in never used as input data in the last batch. Those tokens are always only used as targets and thus the total_loss variable shouldn't be divided by len(data_source) but len(data_source) - 1 instead.
- Loading branch information