abs#

rbc.stdlib.elementwise_functions.abs(x)#

Calculates the absolute value for each element x_i of the input array x.

Examples

>>> from rbc.stdlib import array_api
>>> @heavydb('double[](double[])')
... def array_api_abs(arr):
...     return array_api.abs(arr)
>>> array_api_abs([-1.0, 2.0, -3.0]).execute()
array([1., 2., 3.], dtype=float32)

Array-API ‘abs’ doc