dpnp.tensor.abs

dpnp.tensor.abs

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

Parameters:
  • x (usm_ndarray) -- Input array. May have any data type.

  • out ({None, usm_ndarray}, optional) --

    Output array to populate. Array must have the correct shape and the expected data type.

    Default: None.

  • order -- Memory layout of the new output array, if parameter out is None.

Returns:

out -- An array containing the element-wise absolute values. For complex input, the absolute value is its magnitude. If x has a real-valued data type, the returned array has the same data type as x. If x has a complex floating-point data type, the returned array has a real-valued floating-point data type whose precision matches the precision of x.

Return type:

usm_ndarray