mindspore.ops.flip

View Source On Gitee
mindspore.ops.flip(input, dims)[source]

Reverses elements in a tensor along the given dims.

Parameters
Returns

Tensor

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> input = mindspore.tensor(mindspore.ops.arange(1, 9).reshape((2, 2, 2)))
>>> output = mindspore.ops.flip(input, (0, 2))
>>> print(output)
[[[6 5]
  [8 7]]
 [[2 1]
  [4 3]]]