-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Make actor ID optional for single-network torch policies
- Loading branch information
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"""Torch policy mechanics tests.""" | ||
|
||
from maze.test.shared_test_utils.helper_functions import build_dummy_maze_env, \ | ||
flatten_concat_probabilistic_policy_for_env | ||
|
||
|
||
def test_actor_id_is_optional_for_single_network_policies(): | ||
env = build_dummy_maze_env() | ||
policy = flatten_concat_probabilistic_policy_for_env(env) | ||
|
||
obs = env.reset() | ||
action = policy.compute_action(obs) # No actor ID provided | ||
assert action in env.action_space |