Skip to content

Commit

Permalink
make BalancingLearner picklable
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Apr 9, 2020
1 parent ea617a4 commit aff10f3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions adaptive/learner/balancing_learner.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,3 +440,16 @@ def _get_data(self):
def _set_data(self, data):
for l, _data in zip(self.learners, data):
l._set_data(_data)

def __getstate__(self):
return (
self.learners,
self.cdims,
self.strategy,
self._get_data(),
)

def __setstate__(self, state):
learners, cdims, strategy, data = state
self.__init__(learners, cdims=cdims, strategy=strategy)
self._set_data(data)

0 comments on commit aff10f3

Please sign in to comment.