Rate this Page
★ ★ ★ ★ ★

TensorDictBase.minimum#

TensorDictBase.minimum_(other: TensorCollection | Tensor) → Self#

Replaces every leaf with its element-wise minimum with other in place and returns self.

The in-place version of minimum(). It has no default: a tensordict other must have every key of the tensordict, and its other keys are ignored.

Parameters:

other (TensorDictBase, Tensor or Number) – the other operand, paired with the leaves as in minimum(). A tensor is aligned with the batch dimensions of each leaf, except when a leaf is an UnbatchedTensor or inside a torch.func transform such as torch.vmap(): then every leaf broadcasts with it from the right, as in torch.

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