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.

  • 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.


A view of x with the entries of axis reversed.

Return type: