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

28 lines
1.1 KiB
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.ops.MatrixPower
=========================
.. py:class:: mindspore.ops.MatrixPower(n)
计算一个batch的方阵的n次幂。
如果 :math:`n=0` 则返回一个batch的单位矩阵。
如果n为负数则返回每个矩阵如果可逆逆矩阵的 :math:`abs(n)` 次幂。
.. warning::
这是一个实验性API后续可能修改或删除。
参数:
- **n** (int) - 指数,必须是整数。
输入:
- **x** (Tensor) - 一个3-D Tensor。shape为 :math:`(b, m, m)` 表示b个m-D的方阵。
输出:
- **y** (Tensor) - 一个3-D Tensor`x` 的shape和数据类型均相同。
异常:
- **TypeError** - 如果 `n` 的数据类型不是整数。
- **TypeError** - 如果 `x` 不是Tensor。
- **ValueError** - 如果 `x` 不是一个3-D Tensor。
- **ValueError** - 如果 `x` 的shape[1]和shape[2]不同。
- **ValueError** - 如果 `n` 为负数,但是输入 `x` 中存在奇异矩阵。
- **ValueError** - 如果 `n` < 0 且输入为int类型。