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.
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
[Feature] Extend TensorDictPrimer default_value options #2071
[Feature] Extend TensorDictPrimer default_value options #2071
Changes from 1 commit
c46e0fd
822c04c
c5f1a47
667e21e
e088240
28525cd
9e6c415
657bf9f
25fc14a
b97f727
79f8772
8895b62
e3dcfb9
a1cb9a1
5a86c25
a64a97e
311f40b
3219150
891bd42
9853121
1625514
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about passing through a tensordict to represent this?
For instance, this format will be messy with nested keys
but if you use tensordict nightly you get a nice representation:
which prints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since tensordict accepts whatever value now, we could even not transform it back to a dict
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That way the default value structure will be 100% identical with the CompositeSpec that we use to represent the specs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah very cool option @vmoens !
atm I need to transform it back to dict, because I get the following behaviour for non-tensor data:
output:
So non-tensor data ara not considered leafs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you using the latest nightly?
You can always define your own is_leaf for keys:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was using the latest commit, yes. But this solution works fine :)