mindspore.ops.fliplr

View Source On Gitee
mindspore.ops.fliplr(input)[source]

Flips the elements of each row in the left/right direction, while preserving the columns of the input tensor.

Parameters

input (Tensor) – Input tensor.

Returns

Tensor after the flip.

Raises

TypeError – If the input is not a tensor.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore as ms
>>> from mindspore import ops
>>> import numpy as np
>>> input = ms.Tensor(np.arange(1, 9).reshape((2, 2, 2)))
>>> output = ops.fliplr(input)
>>> print(output)
[[[3 4]
  [1 2]]
 [[7 8]
  [5 6]]]