abs

ivy.abs(x, f=None)[source]

Returns the absolute value of each element in x.

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

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

Returns

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