any¶
- nvtripy.any(input: Tensor, dim: int | Sequence[int] | None = None, keepdim: bool = False) Tensor[source]¶
Returns a new tensor containing the logical OR of the elements of the input tensor along the specified dimension.
- Parameters:
- Returns:
A new bool tensor.
- Return type:
Example
1input = tp.Tensor([True, False]) 2out = tp.any(input)
Local Variables¶>>> input tensor([True, False], dtype=bool, loc=cpu:0, shape=(2,)) >>> out tensor(1, dtype=bool, loc=gpu:0, shape=())