Repository navigation
[BugFix] Treat FlattenAction NestedKey tuples as one key - #4476
Open
YeonwooSung wants to merge 3 commits into
Open
YeonwooSung wants to merge 3 commits into
YeonwooSung wants to merge 3 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/4476
Note: Links to docs will display an error until the docs builds have been completed.
|
Contributor
|
What about insinstance(key, NestedKey)? |
YeonwooSung
force-pushed
the
bugfix/4464-flatten-action-nestedkey
branch
from
September 23, 2026 01:37
569feb0 to
58945fb
Compare
Contributor
Author
|
|
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ActionScalingandFlattenActionwrappedin_keys_invwithisinstance(..., (list, tuple)). A NestedKey("agent", "action")is a tuple, so it was treated as two keys"agent"and"action".ActionScalingthen raised (single action key per instance).FlattenActiondefaultedin_keys/out_keys/out_keys_invfromlist(in_keys_inv)and registered the two strings.Both constructors now wrap with
isinstance(..., (str, tuple)), matchingLastActionandTransform. Existing tests that pass a list of NestedKeys still work.in_keys,out_keys, andout_keys_invwere already handled by theTransformsetters.Code example
Motivation and Context
close #4464
Types of changes
Checklist