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.true_divide

Provide a true division of the inputs, element-wise.

dpnp.floor_divide

Compute the largest integer smaller or equal to the division of the inputs.

dpnp.negative

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

Calculate 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.sign

Returns an element-wise indication of the sign of a number.

dpnp.exp

Trigonometric exponent, element-wise.

dpnp.exp2

Trigonometric exponent2, element-wise.

dpnp.log

Trigonometric logarithm, element-wise.

dpnp.log2

Trigonometric logarithm, element-wise.

dpnp.log10

Trigonometric logarithm, element-wise.

dpnp.expm1

Trigonometric exponent minus 1, element-wise.

dpnp.log1p

Trigonometric logarithm, element-wise.

dpnp.sqrt

Return the positive square-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.

Trigonometric functions

dpnp.sin

Trigonometric sine, element-wise.

dpnp.cos

Trigonometric cosine, element-wise.

dpnp.tan

Compute 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

Trigonometric hyperbolic sine, element-wise.

dpnp.cosh

Trigonometric hyperbolic cosine, element-wise.

dpnp.tanh

Compute hyperbolic tangent element-wise.

dpnp.arcsinh

Inverse hyperbolic sine, element-wise.

dpnp.arccosh

Trigonometric inverse hyperbolic cosine, element-wise.

dpnp.arctanh

Trigonometric 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 (x1 > x2) element-wise.

dpnp.greater_equal

Return (x1 >= x2) element-wise.

dpnp.less

Return (x1 < x2) element-wise.

dpnp.less_equal

Return (x1 <= x2) element-wise.

dpnp.not_equal

Return (x1 != x2) element-wise.

dpnp.equal

Return (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.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

Calculate 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.