[rllib] Fix trainer state restore (#5257)

This commit is contained in:
Eric Liang 2019-07-23 21:18:58 -07:00 committed by GitHub
parent 9c651f47bb
commit 97c43284a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -151,12 +151,12 @@ def build_trainer(name,
def __getstate__(self):
state = Trainer.__getstate__(self)
state.update(self.state)
state["trainer_state"] = self.state.copy()
return state
def __setstate__(self, state):
Trainer.__setstate__(self, state)
self.state = state
self.state = state["trainer_state"].copy()
@staticmethod
def with_updates(**overrides):