ivy.abs(x: Union[ivy.Array, ivy.NativeArray], f: Optional[ivy.Framework] = None) → Union[ivy.Array, ivy.NativeArray][source]

Returns the absolute value of each element in x.

  • x (array) – Input array containing elements to absolute value.

  • f (ml_framework, optional) – Machine learning framework. Inferred from inputs if None.


A new array of the same shape as input array a, with all values now positive.

Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty