jax.numpy.absolute

Warning

This page was created from a pull request (#9655).

jax.numpy.absolute¶

jax.numpy.absolute(x)[source]¶

Calculate the absolute value element-wise.

LAX-backend implementation of 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