TensorDictBase.data#
- property TensorDictBase.data: Any#
Returns a tensordict containing the .data attributes of the leaf tensors.
The leaves of the result share storage with the leaves of
self, and do not require gradients. An in-place change to the result changesself.Assigning
td.data = otherrebinds the.dataof each leaf ofselfto the matching leaf ofother, astorch.Tensor.datadoes. The leaves then share storage withother: memory-mapped or shared-memory leaves stop writing to their file or shared memory.otherand each of its sub-tensordicts must have the batch size of the matching tensordict inself, and each key ofothermust be inself.
Every tensordict class and every tensorclass has this method. For the other methods, see Methods by task.