ivy.abs(x, f=None)[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