dpnp.abs
- dpnp.abs(x, /, out=None, *, order='K', where=True, dtype=None, subok=True, **kwargs)
Calculate the absolute value element-wise.
For full documentation refer to
numpy.absolute.- Returns:
out – An array containing the absolute value of each element in x.
- Return type:
dpnp.ndarray
Limitations
Parameters x is only supported as either
dpnp.ndarrayordpctl.tensor.usm_ndarray. Parameters out, where, dtype and subok are supported with their default values. Keyword argument kwargs is currently unsupported. Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP Data types.See also
dpnp.fabsCalculate the absolute value element-wise excluding complex types.
Notes
dpnp.absis a shorthand for this function.Examples
>>> import dpnp as np >>> a = np.array([-1.2, 1.2]) >>> np.absolute(a) array([1.2, 1.2])
>>> a = np.array(1.2 + 1j) >>> np.absolute(a) array(1.5620499351813308)