Logic Functions

Truth value testing

cupy.all Tests whether all array elements along a given axis evaluate to True.
cupy.any Tests whether any array elements along a given axis evaluate to True.
cupy.in1d Tests whether each element of a 1-D array is also present in a second array.
cupy.isin Calculates element in test_elements, broadcasting over element only.

Infinities and NaNs

cupy.isfinite Tests finiteness elementwise.
cupy.isinf Tests if each element is the positive or negative infinity.
cupy.isnan Tests if each element is a NaN.

Array type testing

cupy.iscomplex Returns a bool array, where True if input element is complex.
cupy.iscomplexobj Check for a complex type or an array of complex numbers.
cupy.isfortran Returns True if the array is Fortran contiguous but not C contiguous.
cupy.isreal Returns a bool array, where True if input element is real.
cupy.isrealobj Return True if x is a not complex type or an array of complex numbers.
cupy.isscalar Returns True if the type of num is a scalar type.

Logic operations

cupy.logical_and Computes the logical AND of two arrays.
cupy.logical_or Computes the logical OR of two arrays.
cupy.logical_not Computes the logical NOT of an array.
cupy.logical_xor Computes the logical XOR of two arrays.

Comparison

cupy.allclose Returns True if two arrays are element-wise equal within a tolerance.
cupy.isclose Returns a boolean array where two arrays are equal within a tolerance.
cupy.greater Tests elementwise if x1 > x2.
cupy.greater_equal Tests elementwise if x1 >= x2.
cupy.less Tests elementwise if x1 < x2.
cupy.less_equal Tests elementwise if x1 <= x2.
cupy.equal Tests elementwise if x1 == x2.
cupy.not_equal Tests elementwise if x1 != x2.