Skip to content

Commit

Permalink
Merge pull request #25 from levelfour/fix-map-update
Browse files Browse the repository at this point in the history
MutableMapping.update may cause problems?
  • Loading branch information
moskomule authored Oct 4, 2019
2 parents 3f3b880 + c3be224 commit 59eab55
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion homura/trainers.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ def _iteration(self,
results = dict(loss=loss, output=output)
self._iteration_map.update(**results)
else:
self._iteration_map.update(**results)
for k in results:
self._iteration_map[k] = results[k]
self._iteration_map[DATA] = data
with torch.no_grad():
self._callbacks.after_iteration(self._iteration_map)
Expand Down

0 comments on commit 59eab55

Please sign in to comment.