Skip to content

Fix missing case for GlobalCategoricalActionSpace #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
8 changes: 4 additions & 4 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ jobs:
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry run pip install torch
run: pip install torch==1.12.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry run pip install torch-scatter
run: pip install torch-scatter -f https://data.pyg.org/whl/torch-1.12.0+cpu.html
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
Expand Down Expand Up @@ -109,10 +109,10 @@ jobs:
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry run pip install torch
run: pip install torch==1.12.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry run pip install torch-scatter
run: pip install torch-scatter -f https://data.pyg.org/whl/torch-1.12.0+cpu.html
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion entity_gym/env/vec_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ def batch_obs(
for atype, space in action_space.items():
if atype not in o.actions:
if atype in action_masks:
if isinstance(space, CategoricalActionSpace):
if isinstance(space, CategoricalActionSpace) or isinstance(
space, GlobalCategoricalActionSpace
):
vec_action = action_masks[atype]
assert isinstance(vec_action, VecCategoricalActionMask)
vec_action.actors.push(np.zeros((0, 1), dtype=np.int64))
Expand Down