[TorchClassifierAgent]Don't share optimizer if we don't have it
* Fix
* add test
* Revert "add test"
This reverts commit
@@ -193,6 +193,7 @@ class TorchClassifierAgent(TorchAgent):
shared['class_list'] = self.class_list
shared['class_weights'] = self.class_weights
shared['model'] = self.model
+ if hasattr(self, 'optimizer'):
shared['optimizer'] = self.optimizer
return shared
