Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/objectives/test_dqn.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ def test_dqn_prioritized_weights(self):
# Sample again - weights should now be non-equal
sample2 = rb.sample()
weights2 = sample2["priority_weight"]
assert weights2.std() > 1e-5
assert weights2.std() > 1e-6

# Run loss again with varied weights
loss_out2 = loss_fn(sample2)
Expand Down Expand Up @@ -1300,7 +1300,7 @@ def test_dqn_prioritized_weights(self):
# Sample again - weights should now be non-equal
sample2 = rb.sample()
weights2 = sample2["priority_weight"]
assert weights2.std() > 1e-5
assert weights2.std() > 1e-6

# Run loss again with varied weights
loss_out2 = loss_fn(sample2)
Expand Down
2 changes: 2 additions & 0 deletions torchrl/envs/libs/pettingzoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,8 @@ def _update_action_mask(self, td, observation_dict, info_dict):
group_mask = td.get((group, "action_mask"))
group_mask += True
for index, agent in enumerate(agents):
if agent not in observation_dict:
continue
agent_obs = observation_dict[agent]
agent_info = info_dict[agent]
if isinstance(agent_obs, dict) and "action_mask" in agent_obs:
Expand Down
Loading