Skip to content

Commit

Permalink
Fix/mse memleak (#507)
Browse files Browse the repository at this point in the history
* Fix memory leak with mse primitive

* Update changelog

* Update CHANGELOG.md
  • Loading branch information
MattPainter01 committed Feb 14, 2019
1 parent a726222 commit 89c2724
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Fixed
- Fixed a bug in the weight decay callback which would result in potentially negative decay (now just uses torch.norm)
- Fixed a bug in the cite decorator causing the citation to not show up correctly
- Fixed a memory leak in the mse primitive metric

## [0.2.6] - 2018-12-19
### Added
Expand Down
2 changes: 1 addition & 1 deletion torchbearer/metrics/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def process(self, *args):
state = args[0]
y_pred = state[self.pred_key]
y_true = state[self.target_key]
return torch.pow(y_pred - y_true.view_as(y_pred), 2)
return torch.pow(y_pred - y_true.view_as(y_pred), 2).data


@default_for_key('loss')
Expand Down

0 comments on commit 89c2724

Please sign in to comment.