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

20 lines
740 B
ReStructuredText
Raw Permalink Normal View History

2023-01-12 16:05:06 +08:00
mindspore.ops.movedim
======================
.. py:function:: mindspore.ops.movedim(x, source, destination)
`x``source` 中位置的维度移动到 `destination` 中的位置。
其它维度保留在原始位置。
2023-02-02 17:30:57 +08:00
参数:
2023-02-06 14:07:23 +08:00
- **x** (Tensor) - 维度需要被移动的的Tensor。
- **source** (Union[int, sequence[int]]) - 要移动的维度的原始位置。源维和目标维必须不同。
- **destination** (Union[int, sequence[int]]) - 每个维度的目标位置。源维和目标维必须不同。
2023-01-12 16:05:06 +08:00
2023-02-02 17:30:57 +08:00
返回:
2023-01-12 16:05:06 +08:00
维度已经被移动的的Tensor。
2023-02-02 17:30:57 +08:00
异常:
2023-01-12 16:05:06 +08:00
- **ValueError** - 如果维度不在 [-x.ndim, x.ndim) 的范围内,或者维度包含重复值。