mirror of
https://github.com/wassname/ray.git
synced 2026-07-31 12:41:01 +08:00
[RLlib]: Trajectory View API: Keep env infos (e.g. for postprocessing callbacks), no matter what. (#13555)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user