jax.numpy.abs

Contents

jax.numpy.abs#

jax.numpy.abs(x, /)#

Calculate the absolute value element-wise.

LAX-backend implementation of numpy.absolute().

Original docstring below.

np.abs is a shorthand for this function.

Parameters:

x (array_like) – Input array.

Returns:

absolute – An ndarray containing the absolute value of each element in x. For complex input, a + ib, the absolute value is \(\sqrt{ a^2 + b^2 }\). This is a scalar if x is a scalar.

Return type:

ndarray