mindspore/docs/api/api_python/mint/mindspore.mint.func_pow.rst

28 lines
1.4 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.mint.pow
==================
.. py:function:: mindspore.mint.pow(input, exponent)
计算 `input` 中每个元素的 `exponent` 次幂。
`exponent` 是Tensor时 `input``exponent` 的shape必须是可广播的。
.. math::
out_{i} = input_{i} ^{ exponent_{i}}
.. warning::
这是一个实验性API后续可能修改或删除。
参数:
- **input** (Union[Tensor, Number]) - 第一个输入是一个Number值或数据类型为 `number <https://www.mindspore.cn/docs/zh-CN/master/api_python/mindspore/mindspore.dtype.html#mindspore.dtype>`_`bool <https://www.mindspore.cn/docs/zh-CN/master/api_python/mindspore/mindspore.dtype.html#mindspore.dtype>`_ 的Tensor。
- **exponent** (Union[Tensor, Number]) - 第二个输入是一个Number值或数据类型为 `number <https://www.mindspore.cn/docs/zh-CN/master/api_python/mindspore/mindspore.dtype.html#mindspore.dtype>`_`bool <https://www.mindspore.cn/docs/zh-CN/master/api_python/mindspore/mindspore.dtype.html#mindspore.dtype>`_ 的Tensor。
返回:
Tensorshape与广播后的shape相同数据类型为两个输入中精度较高的类型。
异常:
- **TypeError** - `input``exponent` 同时为 bool 类型。
- **TypeError** - `input` 是一个Tensor且为 int 或 bool 类型,而 `exponent` 是一个Scalar且值为负整型时。