dpctl.tensor.abs

dpctl.tensor.abs

abs(x, /, *, out=None, order=’K’)

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

Parameters:
  • x (usm_ndarray) – Input array.

  • out (Union[usm_ndarray, None], optional) – Output array to populate. Array must have the correct shape and the expected data type.

  • order ("C","F","A","K", optional) – Memory layout of the new output array, if parameter out is None. Default: “K”.

Returns:

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