mindspore/docs/api/api_python/ops/mindspore.ops.func_rot90.rst

23 lines
901 B
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.rot90
=======================
.. py:function:: mindspore.ops.rot90(x, k, dims)
沿轴指定的平面内将n-D Tensor旋转90度。
如果k>0旋转方向是从第一轴朝向第二轴如果k<0旋转方向从第二轴朝向第一轴。
参数:
- **x** (Tensor) - 所输入的Tensor。
- **k** (int) - 旋转的次数。默认值1。
- **dims** (Union[list(int), tuple(int)]) - 要旋转的轴。默认值:[0,1]。
返回:
Tensor。
异常:
- **TypeError** - 输入不是Tensor。
- **TypeError** - `k` 不是整数。
- **TypeError** - `dims` 不是整数组成的list或者tuple。
- **ValueError** - `dims` 长度不为2。
- **ValueError** - `dims` 中的元素不在输入Tensor的[-x.ndim, x.ndim)之间。
- **RuntimeError** - `dims` 的两个元素相同。