mindspore.mint.all
- mindspore.mint.all(input) Tensor [source]
Tests if all element in input evaluates to True.
- Parameters
input (Tensor) – The input Tensor.
- Returns
Tensor
- Supported Platforms:
Ascend
Examples
>>> import mindspore >>> input = mindspore.tensor([[True, False], [True, True]]) >>> output = mindspore.mint.all(input) >>> print(output) False
Tests if all element in input evaluates to True along the given axes.
- Parameters
- Returns
Tensor
- Supported Platforms:
Ascend
Examples
>>> import mindspore >>> input = mindspore.tensor([[True, False], [True, True]]) >>> >>> # case 1: Reduces a dimension along dim 1, with keepdim False. >>> mindspore.mint.all(input, dim=1) Tensor(shape=[2], dtype=Bool, value= [False, True]) >>> >>> # case 2: Reduces a dimension along dim (0, 1), with keepdim False. >>> mindspore.mint.all(input, dim=(0,1)) Tensor(shape=[], dtype=Bool, value= False) >>> >>> # case 3: Reduces a dimension along dim [0, 1], with keepdim True. >>> mindspore.mint.all(input, dim=[0,1], keepdim=True) Tensor(shape=[1, 1], dtype=Bool, value= [[False]])