Universal Functions (ufunc)
DPNP provides universal functions (a.k.a. ufuncs) to support various element-wise operations.
Available ufuncs
Math operations
Calculates the sum for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Calculates the difference between each element x1_i of the input array x1 and the respective element x2_i of the input array x2. |
|
Calculates the product for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Calculates the ratio for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Calculates the natural logarithm of the sum of exponents for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Calculates the ratio for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Calculates the ratio for each element x1_i of the input array x1 with the respective element x2_i of the input array x2 to the greatest integer-value number that is not greater than the division result. |
|
Computes the numerical negative for each element x_i of input array x. |
|
Calculates x1_i raised to x2_i for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Calculates the remainder of division for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Compute element-wise remainder of division. |
|
Returns the element-wise remainder of division. |
|
Calculates the absolute value for each element x_i of input array x. |
|
Calculates the absolute value for each element x_i of input array x. |
|
Compute the absolute values element-wise. |
|
Rounds each element x_i of the input array x to the nearest integer-valued number. |
|
Computes an indication of the sign of each element x_i of input array x using the signum function. |
|
Computes the exponent for each element x_i of input array x. |
|
Computes the base-2 exponent for each element x_i for input array x. |
|
Computes the natural logarithm for each element x_i of input array x. |
|
Computes the base-2 logarithm for each element x_i of input array x. |
|
Computes the base-10 logarithm for each element x_i of input array x. |
|
Computes the exponent minus 1 for each element x_i of input array x. |
|
Computes the natural logarithm of (1 + x) for each element x_i of input array x. |
|
Computes projection of each element x_i for input array x. |
|
Computes the positive square-root for each element x_i of input array x. |
|
Computes positive cube-root for each element x_i for input array x. |
|
Squares each element x_i of input array x. |
|
Computes the reciprocal square-root for each element x_i for input array x. |
|
Computes the reciprocal square-root for each element x_i for input array x. |
Trigonometric functions
Computes sine for each element x_i of input array x. |
|
Computes cosine for each element x_i for input array x. |
|
Computes tangent for each element x_i for input array x. |
|
Computes inverse sine for each element x_i for input array x. |
|
Computes inverse cosine for each element x_i for input array x. |
|
Computes inverse tangent for each element x_i for input array x. |
|
Calculates the inverse tangent of the quotient x1_i/x2_i for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Calculates the hypotenuse for a right triangle with "legs" x1_i and x2_i of input arrays x1 and x2. |
|
Computes hyperbolic sine for each element x_i for input array x. |
|
Computes hyperbolic cosine for each element x_i for input array x. |
|
Computes hyperbolic tangent for each element x_i for input array x. |
|
Computes inverse hyperbolic sine for each element x_i for input array x. |
|
Computes inverse hyperbolic cosine for each element x_i for input array x. |
|
Computes hyperbolic inverse tangent for each element x_i for input array x. |
|
Convert angles from degrees to radians. |
|
Convert angles from radians to degrees. |
Bit-twiddling functions
Computes the bitwise AND of the underlying binary representation of each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Computes the bitwise OR of the underlying binary representation of each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Computes the bitwise XOR of the underlying binary representation of each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Inverts (flips) each bit for each element x_i of the input array x. |
|
Shifts the bits of each element x1_i of the input array x1 to the left by appending x2_i (i.e., the respective element in the input array x2) zeros to the right of x1_i. |
|
Shifts the bits of each element x1_i of the input array x1 to the right according to the respective element x2_i of the input array x2. |
Comparison functions
Computes the greater-than test results for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Computes the greater-than or equal-to test results for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Computes the less-than test results for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Computes the less-than or equal-to test results for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Calculates inequality test results for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Calculates equality test results for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Computes the logical AND for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Computes the logical OR for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Computes the logical XOR for each element x1_i of the input array x1 with the respective element x2_i of the input array x2. |
|
Computes the logical NOT for each element x_i of input array x. |
|
Compares two input arrays x1 and x2 and returns a new array containing the element-wise maxima. |
|
Compares two input arrays x1 and x2 and returns a new array containing the element-wise minima. |
|
Element-wise maximum of array elements. |
|
Element-wise minimum of array elements. |
Floating functions
Test if each element of input array is a finite number. |
|
Test if each element of input array is an infinity. |
|
Test if each element of an input array is a NaN. |
|
Compute the absolute values element-wise. |
|
Computes an indication of whether the sign bit of each element x_i of input array x is set. |
|
Composes a floating-point value with the magnitude of x1_i and the sign of x2_i for each element of input arrays x1 and x2. |
|
Return the fractional and integral parts of an array, element-wise. |
|
Returns the element-wise remainder of division. |
|
Returns the floor for each element x_i for input array x. |
|
Returns the ceiling for each element x_i for input array x. |
|
Returns the truncated value for each element x_i for input array x. |