all¶
- tripy.all(input: Tensor, dim: int | Sequence[int] | None = None, keepdim: bool = False) Tensor [source]¶
Returns a new tensor containing the logical AND of the elements of the input tensor along the specified dimension.
- Parameters:
input (Tensor) – [dtype=T1] The input tensor.
dim (int | Sequence[int] | None) – The dimension or dimensions along which to reduce. If this is not provided, all dimensions are reduced.
keepdim (bool) – Whether to retain reduced dimensions in the output. If this is False, reduced dimensions will be squeezed.
- Returns:
[dtype=T1] A new bool tensor.
- Return type:
- TYPE CONSTRAINTS:
T1:
bool
Example
1input = tp.Tensor([True, True], dtype=tp.bool) 2out = tp.all(input)
>>> input tensor([True, True], dtype=bool, loc=gpu:0, shape=(2,)) >>> out tensor(True, dtype=bool, loc=gpu:0, shape=())