dpctl.tensor.flip

dpctl.tensor.flip(x, axis)[source]

Reverses the order of elements in an array x along the given axis. The shape of the array is preserved, but the elements are reordered.

Parameters:
  • x (usm_ndarray) – input array.

  • axis (Optional[Union[int, Tuple[int,...]]]) – axis (or axes) along which to flip. If axis is None, all input array axes are flipped. If axis is negative, the flipped axis is counted from the last dimension. If provided more than one axis, only the specified axes are flipped. Default: None.

Returns:

A view of x with the entries of axis reversed.

Return type:

usm_ndarray