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

[Feature Request] Nested keys compatibility improvement #22

Open
11 of 14 tasks
vmoens opened this issue Nov 7, 2022 · 0 comments
Open
11 of 14 tasks

[Feature Request] Nested keys compatibility improvement #22

vmoens opened this issue Nov 7, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@vmoens
Copy link
Contributor

vmoens commented Nov 7, 2022

Motivation

We need to improve the compatibility with nested keys. This should include:

  • TensorDict.get(nested_key)
  • TensorDict.set(nested_key, value) (+ creation of the sub-td if the original key is missing)
  • TensorDict.set_(nested_key, value)
  • TensorDict.keys()
  • TensorDict.select(*keys)
  • TensorDict.exclude(*keys)
  • TensorDict.set_default(key, value)
  • TensorDictModule
  • TensorDictSequential

We will cover once it's implemented

  • TensorDict.pop(key)

Contentious methods / unresolved issues:

  • items: we could return the first level by default and return nested ones if a flag is set to true?
  • values: same reason
  • meta-tensor: building the features in parallel for meta-tensor will double the amount of work (?)
  • empty sub-tensordict behaviour: default behaviour would return only leaves, but one could ask for every level OR to return leaf-tensordicts.

cc @tcbegley

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant