Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Element-wise Functions

Array API specification for element-wise functions.

Objects in API

abs(x, /)

Calculates the absolute value for each elementx_i of the input arrayx.

acos(x, /)

Calculates an implementation-dependent approximation of the principal value of the inverse cosine for each elementx_i of the input arrayx.

acosh(x, /)

Calculates an implementation-dependent approximation to the inverse hyperbolic cosine for each elementx_i of the input arrayx.

add(x1, x2, /)

Calculates the sum for each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

asin(x, /)

Calculates an implementation-dependent approximation of the principal value of the inverse sine for each elementx_i of the input arrayx.

asinh(x, /)

Calculates an implementation-dependent approximation to the inverse hyperbolic sine for each elementx_i in the input arrayx.

atan(x, /)

Calculates an implementation-dependent approximation of the principal value of the inverse tangent for each elementx_i of the input arrayx.

atan2(x1, x2, /)

Calculates an implementation-dependent approximation of the inverse tangent of the quotientx1/x2, having domain[-infinity,+infinity]x[-infinity,+infinity] (where thex notation denotes the set of ordered pairs of elements(x1_i,x2_i)) and codomain[-π,+π], for each pair of elements(x1_i,x2_i) of the input arraysx1 andx2, respectively.

atanh(x, /)

Calculates an implementation-dependent approximation to the inverse hyperbolic tangent for each elementx_i of the input arrayx.

bitwise_and(x1, x2, /)

Computes the bitwise AND of the underlying binary representation of each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

bitwise_left_shift(x1, x2, /)

Shifts the bits of each elementx1_i of the input arrayx1 to the left by appendingx2_i (i.e., the respective element in the input arrayx2) zeros to the right ofx1_i.

bitwise_invert(x, /)

Inverts (flips) each bit for each elementx_i of the input arrayx.

bitwise_or(x1, x2, /)

Computes the bitwise OR of the underlying binary representation of each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

bitwise_right_shift(x1, x2, /)

Shifts the bits of each elementx1_i of the input arrayx1 to the right according to the respective elementx2_i of the input arrayx2.

bitwise_xor(x1, x2, /)

Computes the bitwise XOR of the underlying binary representation of each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

ceil(x, /)

Rounds each elementx_i of the input arrayx to the smallest (i.e., closest to-infinity) integer-valued number that is not less thanx_i.

clip(x, /, min=None, max=None)

Clamps each elementx_i of the input arrayx to the range[min,max].

conj(x, /)

Returns the complex conjugate for each elementx_i of the input arrayx.

copysign(x1, x2, /)

Composes a floating-point value with the magnitude ofx1_i and the sign ofx2_i for each element of the input arrayx1.

cos(x, /)

Calculates an implementation-dependent approximation to the cosine for each elementx_i of the input arrayx.

cosh(x, /)

Calculates an implementation-dependent approximation to the hyperbolic cosine for each elementx_i in the input arrayx.

divide(x1, x2, /)

Calculates the division of each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

equal(x1, x2, /)

Computes the truth value ofx1_i==x2_i for each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

exp(x, /)

Calculates an implementation-dependent approximation to the exponential function for each elementx_i of the input arrayx (e raised to the power ofx_i, wheree is the base of the natural logarithm).

expm1(x, /)

Calculates an implementation-dependent approximation toexp(x)-1 for each elementx_i of the input arrayx.

floor(x, /)

Rounds each elementx_i of the input arrayx to the greatest (i.e., closest to+infinity) integer-valued number that is not greater thanx_i.

floor_divide(x1, x2, /)

Rounds the result of dividing each elementx1_i of the input arrayx1 by the respective elementx2_i of the input arrayx2 to the greatest (i.e., closest to+infinity) integer-value number that is not greater than the division result.

greater(x1, x2, /)

Computes the truth value ofx1_i>x2_i for each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

greater_equal(x1, x2, /)

Computes the truth value ofx1_i>=x2_i for each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

hypot(x1, x2, /)

Computes the square root of the sum of squares for each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

imag(x, /)

Returns the imaginary component of a complex number for each elementx_i of the input arrayx.

isfinite(x, /)

Tests each elementx_i of the input arrayx to determine if finite.

isinf(x, /)

Tests each elementx_i of the input arrayx to determine if equal to positive or negative infinity.

isnan(x, /)

Tests each elementx_i of the input arrayx to determine whether the element isNaN.

less(x1, x2, /)

Computes the truth value ofx1_i<x2_i for each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

less_equal(x1, x2, /)

Computes the truth value ofx1_i<=x2_i for each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

log(x, /)

Calculates an implementation-dependent approximation to the natural (basee) logarithm for each elementx_i of the input arrayx.

log1p(x, /)

Calculates an implementation-dependent approximation tolog(1+x), wherelog refers to the natural (basee) logarithm, for each elementx_i of the input arrayx.

log2(x, /)

Calculates an implementation-dependent approximation to the base2 logarithm for each elementx_i of the input arrayx.

log10(x, /)

Calculates an implementation-dependent approximation to the base10 logarithm for each elementx_i of the input arrayx.

logaddexp(x1, x2, /)

Calculates the logarithm of the sum of exponentiationslog(exp(x1)+exp(x2)) for each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

logical_and(x1, x2, /)

Computes the logical AND for each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

logical_not(x, /)

Computes the logical NOT for each elementx_i of the input arrayx.

logical_or(x1, x2, /)

Computes the logical OR for each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

logical_xor(x1, x2, /)

Computes the logical XOR for each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

maximum(x1, x2, /)

Computes the maximum value for each elementx1_i of the input arrayx1 relative to the respective elementx2_i of the input arrayx2.

minimum(x1, x2, /)

Computes the minimum value for each elementx1_i of the input arrayx1 relative to the respective elementx2_i of the input arrayx2.

multiply(x1, x2, /)

Calculates the product for each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

negative(x, /)

Computes the numerical negative of each elementx_i (i.e.,y_i=-x_i) of the input arrayx.

nextafter(x1, x2, /)

Returns the next representable floating-point value for each elementx1_i of the input arrayx1 in the direction of the respective elementx2_i of the input arrayx2.

not_equal(x1, x2, /)

Computes the truth value ofx1_i!=x2_i for each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

positive(x, /)

Computes the numerical positive of each elementx_i (i.e.,y_i=+x_i) of the input arrayx.

pow(x1, x2, /)

Calculates an implementation-dependent approximation of exponentiation by raising each elementx1_i (the base) of the input arrayx1 to the power ofx2_i (the exponent), wherex2_i is the corresponding element of the input arrayx2.

real(x, /)

Returns the real component of a complex number for each elementx_i of the input arrayx.

reciprocal(x, /)

Returns the reciprocal for each elementx_i of the input arrayx.

remainder(x1, x2, /)

Returns the remainder of division for each elementx1_i of the input arrayx1 and the respective elementx2_i of the input arrayx2.

round(x, /)

Rounds each elementx_i of the input arrayx to the nearest integer-valued number.

sign(x, /)

Returns an indication of the sign of a number for each elementx_i of the input arrayx.

signbit(x, /)

Determines whether the sign bit is set for each elementx_i of the input arrayx.

sin(x, /)

Calculates an implementation-dependent approximation to the sine for each elementx_i of the input arrayx.

sinh(x, /)

Calculates an implementation-dependent approximation to the hyperbolic sine for each elementx_i of the input arrayx.

square(x, /)

Squares each elementx_i of the input arrayx.

sqrt(x, /)

Calculates the principal square root for each elementx_i of the input arrayx.

subtract(x1, x2, /)

Calculates the difference for each elementx1_i of the input arrayx1 with the respective elementx2_i of the input arrayx2.

tan(x, /)

Calculates an implementation-dependent approximation to the tangent for each elementx_i of the input arrayx.

tanh(x, /)

Calculates an implementation-dependent approximation to the hyperbolic tangent for each elementx_i of the input arrayx.

trunc(x, /)

Rounds each elementx_i of the input arrayx to the nearest integer-valued number that is closer to zero thanx_i.


[8]ページ先頭

©2009-2025 Movatter.jp