You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, the add function is implemented between two tensordicts.
Yet which of the leaves of two tensordicts are added is determined by their position in the respective tensordicts, not their explicit keys.
ludwigwinkler
changed the title
Implemented Operations between two TensorDicts is defined by their position in their respective trees, not their keys
Implemented Operations between two TensorDicts are defined by their position in their respective trees, not their keys
Jul 5, 2024
Describe the bug
For example, the add function is implemented between two tensordicts.
Yet which of the leaves of two tensordicts are added is determined by their position in the respective tensordicts, not their explicit keys.
To Reproduce
Output:
Here the leaves are processed irrespective of their key.
Thus position in the tree trumps the keys.
Additional context
I just became aware of
tensordict.apply()
which should probably be used instead and implements atree_map()
functionality?As far as I can tell, maybe the
add
functionality here should use an items() iterator which sortes the values by their keys?tensordict/tensordict/base.py
Line 7026 in 6165e77
The text was updated successfully, but these errors were encountered: