Universal Functions (ufunc)

DPNP provides universal functions (a.k.a. ufuncs) to support various elementwise operations.

Available ufuncs

Math operations

 `dpnp.add` Add arguments element-wise. `dpnp.subtract` Subtract arguments, element-wise. `dpnp.multiply` Multiply arguments element-wise. `dpnp.divide` Divide arguments element-wise. `dpnp.logaddexp` Calculates `log(exp(x1) + exp(x2))`, element-wise. `dpnp.true_divide` Divide arguments element-wise. `dpnp.floor_divide` Compute the largest integer smaller or equal to the division of the inputs. `dpnp.negative` Numerical negative, element-wise. `dpnp.power` First array elements raised to powers from second array, element-wise. `dpnp.remainder` Return element-wise remainder of division. `dpnp.mod` Compute element-wise remainder of division. `dpnp.fmod` Returns the element-wise remainder of division. `dpnp.abs` Calculate the absolute value element-wise. `dpnp.absolute` Calculate the absolute value element-wise. `dpnp.fabs` Compute the absolute values element-wise. `dpnp.rint` Round elements of the array to the nearest integer. `dpnp.sign` Returns an element-wise indication of the sign of a number. `dpnp.exp` Calculate the exponential, element-wise. `dpnp.exp2` Calculate 2**p for all p in the input array. `dpnp.log` Natural logarithm, element-wise. `dpnp.log2` Return the base 2 logarithm of the input array, element-wise. `dpnp.log10` Return the base 10 logarithm of the input array, element-wise. `dpnp.expm1` Return the exponential of the input array minus one, element-wise. `dpnp.log1p` Return the natural logarithm of one plus the input array, element-wise. `dpnp.proj` Returns the projection of a number onto the Riemann sphere. `dpnp.sqrt` Return the non-negative square-root of an array, element-wise. `dpnp.cbrt` Return the cube-root of an array, element-wise. `dpnp.square` Return the element-wise square of the input. `dpnp.reciprocal` Return the reciprocal of the argument, element-wise. `dpnp.rsqrt` Computes the reciprocal square-root for each element x_i for input array x.

Trigonometric functions

 `dpnp.sin` Trigonometric sine, element-wise. `dpnp.cos` Trigonometric cosine, element-wise. `dpnp.tan` Trigonometric tangent, element-wise. `dpnp.arcsin` Inverse sine, element-wise. `dpnp.arccos` Trigonometric inverse cosine, element-wise. `dpnp.arctan` Trigonometric inverse tangent, element-wise. `dpnp.arctan2` Element-wise arc tangent of x1/x2 choosing the quadrant correctly. `dpnp.hypot` Given the "legs" of a right triangle, return its hypotenuse. `dpnp.sinh` Hyperbolic sine, element-wise. `dpnp.cosh` Hyperbolic cosine, element-wise. `dpnp.tanh` Compute hyperbolic tangent element-wise. `dpnp.arcsinh` Inverse hyperbolic sine, element-wise. `dpnp.arccosh` Inverse hyperbolic cosine, element-wise. `dpnp.arctanh` Hyperbolic inverse tangent, element-wise. `dpnp.deg2rad` Convert angles from degrees to radians. `dpnp.rad2deg` Convert angles from radians to degrees.

Bit-twiddling functions

 `dpnp.bitwise_and` Compute the bit-wise AND of two arrays element-wise. `dpnp.bitwise_or` Compute the bit-wise OR of two arrays element-wise. `dpnp.bitwise_xor` Compute the bit-wise XOR of two arrays element-wise. `dpnp.invert` Compute bit-wise inversion, or bit-wise NOT, element-wise. `dpnp.left_shift` Shift the bits of an integer to the left. `dpnp.right_shift` Shift the bits of an integer to the right.

Comparison functions

 `dpnp.greater` Return the truth value of (x1 > x2) element-wise. `dpnp.greater_equal` Return the truth value of (x1 >= x2) element-wise. `dpnp.less` Return the truth value of (x1 < x2) element-wise. `dpnp.less_equal` Return the truth value of (x1 <= x2) element-wise. `dpnp.not_equal` Return the truth value of (x1 != x2) element-wise. `dpnp.equal` Return the truth value of (x1 == x2) element-wise. `dpnp.logical_and` Compute the truth value of x1 AND x2 element-wise. `dpnp.logical_or` Compute the truth value of x1 OR x2 element-wise. `dpnp.logical_xor` Compute the truth value of x1 XOR x2 element-wise. `dpnp.logical_not` Compute the truth value of NOT x element-wise. `dpnp.maximum` Element-wise maximum of array elements. `dpnp.minimum` Element-wise minimum of array elements. `dpnp.fmax` Element-wise maximum of array elements. `dpnp.fmin` Element-wise minimum of array elements.

Floating functions

 `dpnp.isfinite` Test element-wise for finiteness (not infinity or not Not a Number). `dpnp.isinf` Test element-wise for positive or negative infinity. `dpnp.isnan` Test element-wise for NaN and return result as a boolean array. `dpnp.fabs` Compute the absolute values element-wise. `dpnp.signbit` Returns element-wise True where signbit is set (less than zero). `dpnp.copysign` Change the sign of x1 to that of x2, element-wise. `dpnp.modf` Return the fractional and integral parts of an array, element-wise. `dpnp.fmod` Returns the element-wise remainder of division. `dpnp.floor` Round a number to the nearest integer toward minus infinity. `dpnp.ceil` Compute the ceiling of the input, element-wise. `dpnp.trunc` Compute the truncated value of the input, element-wise.