mindspore.ops.flipud

mindspore.ops.flipud(x)[source]

Flips the entries in each column in the up/down direction. Rows are preserved, but appear in a different order than before.

Parameters

x (Tensor) – Input array.

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