mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
[RLlib]: Trajectory View API: Keep env infos (e.g. for postprocessing callbacks), no matter what. (#13555)
This commit is contained in:
parent
2092b097ea
commit
d7301a51f4
2 changed files with 4 additions and 4 deletions
|
@ -590,12 +590,12 @@ class DynamicTFPolicy(TFPolicy):
|
|||
del self._loss_input_dict[key]
|
||||
# Remove those not needed at all (leave those that are needed
|
||||
# by Sampler to properly execute sample collection).
|
||||
# Also always leave DONES and REWARDS, no matter what.
|
||||
# Also always leave DONES, REWARDS, and INFOS, no matter what.
|
||||
for key in list(self.view_requirements.keys()):
|
||||
if key not in all_accessed_keys and key not in [
|
||||
SampleBatch.EPS_ID, SampleBatch.AGENT_INDEX,
|
||||
SampleBatch.UNROLL_ID, SampleBatch.DONES,
|
||||
SampleBatch.REWARDS] and \
|
||||
SampleBatch.REWARDS, SampleBatch.INFOS] and \
|
||||
key not in self.model.view_requirements:
|
||||
# If user deleted this key manually in postprocessing
|
||||
# fn, warn about it and do not remove from
|
||||
|
|
|
@ -676,12 +676,12 @@ class Policy(metaclass=ABCMeta):
|
|||
self.view_requirements[key].used_for_training = False
|
||||
# Remove those not needed at all (leave those that are needed
|
||||
# by Sampler to properly execute sample collection).
|
||||
# Also always leave DONES and REWARDS, no matter what.
|
||||
# Also always leave DONES, REWARDS, INFOS, no matter what.
|
||||
for key in list(self.view_requirements.keys()):
|
||||
if key not in all_accessed_keys and key not in [
|
||||
SampleBatch.EPS_ID, SampleBatch.AGENT_INDEX,
|
||||
SampleBatch.UNROLL_ID, SampleBatch.DONES,
|
||||
SampleBatch.REWARDS] and \
|
||||
SampleBatch.REWARDS, SampleBatch.INFOS] and \
|
||||
key not in self.model.view_requirements:
|
||||
# If user deleted this key manually in postprocessing
|
||||
# fn, warn about it and do not remove from
|
||||
|
|
Loading…
Add table
Reference in a new issue