Skip to content

Commit

Permalink
[TorchClassifierAgent]Don't share optimizer if we don't have it (face…
Browse files Browse the repository at this point in the history
…bookresearch#2565)

* Fix

* add test

* Revert "add test"

This reverts commit 580d996.
  • Loading branch information
dexterju27 authored Apr 22, 2020
1 parent 9a74445 commit 5519bec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion parlai/core/torch_classifier_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ def share(self):
shared['class_list'] = self.class_list
shared['class_weights'] = self.class_weights
shared['model'] = self.model
shared['optimizer'] = self.optimizer
if hasattr(self, 'optimizer'):
shared['optimizer'] = self.optimizer
return shared

def _get_labels(self, batch):
Expand Down

0 comments on commit 5519bec

Please sign in to comment.