Rate this Page
★ ★ ★ ★ ★

TensorDictBase.apply#

TensorDictBase.apply_(fn: Callable, *others, **kwargs) → Self#

Applies a callable to all values stored in the tensordict and re-writes them in-place.

Parameters:
  • fn (Callable) – function to be applied to the tensors in the tensordict.

  • *others (sequence of TensorDictBase, optional) – the other tensordicts to be used.

Keyword Args: See apply().

Returns:

self

Every tensordict class and every tensorclass has this method. For the other methods, see Methods by task.