mindspore.ops.fliplr
- mindspore.ops.fliplr(x)[source]
Flips the entries in each row in the left/right direction. Columns are preserved, but appear in a different order than before.
- Parameters
x (Tensor) – Input tensor.
- Returns
Tensor.
- Raises
TypeError – If the input is not a tensor.
- Supported Platforms:
GPU
CPU
Examples
>>> import mindspore as ms >>> import mindspore.ops as ops >>> import numpy as np >>> x = ms.Tensor(np.arange(8).reshape((2, 2, 2))) >>> output = ops.fliplr(x) >>> print(output) [[[2. 3.] [0. 1.]] [[6. 7.] [4. 5.]]]