Skip to content
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

[🐛 🔨 ] set_action_for_agent expects a ActionTuple with batch size 1. #5208

Merged
merged 2 commits into from
Mar 31, 2021

Conversation

vincentpierre
Copy link
Contributor

Proposed change(s)

Fixed validate_action to expect the right dimensions when set_action_single_agent is called.
Added a test.

Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)

Types of change(s)

  • Bug fix
  • New feature
  • Code refactor
  • Breaking change
  • Documentation update
  • Other (please describe)

Checklist

  • Added tests that prove my fix is effective or that my feature works
  • Updated the changelog (if applicable)
  • Updated the documentation (if applicable)
  • Updated the migration guide (if applicable)

Other comments

@vincentpierre vincentpierre self-assigned this Mar 31, 2021
@@ -366,7 +366,7 @@ def set_action_for_agent(
return
action_spec = self._env_specs[behavior_name].action_spec
num_agents = len(self._env_state[behavior_name][0])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line can be killed right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, you need it in case you need to create an empty action bellow. It can be moved though, thanks !

@vincentpierre vincentpierre changed the title [Bug Fix] set_action_for_agent expects a ActionTuple with batch size 1. [🐛 🔨 ] set_action_for_agent expects a ActionTuple with batch size 1. Mar 31, 2021
@vincentpierre vincentpierre merged commit aac2ee6 into main Mar 31, 2021
@delete-merged-branch delete-merged-branch bot deleted the fix-set_action_single_agent branch March 31, 2021 20:36
ervteng pushed a commit that referenced this pull request Apr 8, 2021
…5208)

* [Bug Fix] set_action_for_agent expects a ActionTuple with batch size 1.

* moving a line around

(cherry picked from commit aac2ee6)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants