TensorDictBase.any#
- TensorDictBase.any(dim: int | None = None) bool | TensorCollection#
Checks if any value is True/non-null in the tensordict.
- Parameters:
dim (int, optional) – if
None, returns a boolean indicating whether all tensors return tensor.any() == 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.