mindspore.ops.flipud

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

Flips the elements of each column in the up/down direction, while preserving the rows of the input tensor.

Parameters

input (Tensor) – Input array.

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.flipud(input)
>>> print(output)
[[[5 6]
  [7 8]]
 [[1 2]
  [3 4]]]