dpctl.tensor.any

dpctl.tensor.any(x, axis=None, keepdims=False)[source]

Tests whether any input array elements evaluate to True along a given axis.

Parameters:
  • x (usm_ndarray) – Input array.

  • axis (Optional[Union[int, Tuple[int,...]]]) – Axis (or axes) along which to perform a logical OR reduction. When axis is None, a logical OR reduction is performed over all dimensions of x. If axis is negative, the axis is counted from the last dimension to the first. Default: None.

  • keepdims (bool, optional) – If True, the reduced axes are included in the result as singleton dimensions, and the result is broadcastable to the input array shape. If False, the reduced axes are not included in the result. Default: False.

Returns:

An array with a data type of bool containing the results of the logical OR reduction.

Return type:

usm_ndarray