Rate this Page
★ ★ ★ ★ ★

TensorDictBase.all#

TensorDictBase.all(dim: int | None = None) → bool | TensorCollection#

Checks if all values are True/non-null in the tensordict.

Parameters:

dim (int, optional) – if None, returns a boolean indicating whether all tensors return tensor.all() == True If integer, all is called upon the dimension specified if and only if this dimension is compatible with the tensordict shape.

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