mindspore/docs/api/api_python/numpy/mindspore.numpy.transpose.rst

17 lines
622 B
ReStructuredText
Raw Permalink 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.numpy.transpose
=================================
.. py:function:: mindspore.numpy.transpose(a, axes=None)
反转或交换Tensor的轴返回修改后的Tensor。
参数:
- **a** (Tensor) - 要转置的Tensor。
- **axes** (Union[None, tuple, list],可选) - 轴的顺序。如果 ``axes````None`` 则转置整个Tensor。默认值 ``None``
返回:
Tensor转置后的Tensor数组。
异常:
- **TypeError** - 如果输入参数非上述给定的类型。
- **ValueError** - 如果 ``axes`` 的数量不等于 ``a.ndim``