oops sorry stephpen
@@ -1568,7 +1568,13 @@ class TorchAgent(ABC, Agent):
observation = Message(observation)
# Sanity check everything is in order
- self._validate_observe_invariants(observation)
+ self._validate_observe_invariants()
+
+ if observation.get('episode_done'):
+ self.__expecting_clear_history = True
+ elif 'labels' in observation or 'eval_labels' in observation:
+ # make sure we note that we're expecting a reply in the future
+ self.__expecting_to_reply = True
self.observation = observation
# update the history using the observation
@@ -1638,7 +1644,7 @@ class TorchAgent(ABC, Agent):
raise RuntimeError("Unexpected case in self_observe.")
- def _validate_observe_invariants(self, observation):
+ def _validate_observe_invariants(self):
"""
Check that we properly called self_observe after the last batch_act.
"""
@@ -1658,12 +1664,6 @@ class TorchAgent(ABC, Agent):
"assistance."
)
- if observation.get('episode_done'):
- self.__expecting_clear_history = True
- elif 'labels' in observation or 'eval_labels' in observation:
- # make sure we note that we're expecting a reply in the future
- self.__expecting_to_reply = True
-
def _validate_self_observe_invariants(self):
"""
Check some invariant conditions for self_observe.
