Fix power document problem

Merge pull request  from LiangZhibo/code_docs_pow
This commit is contained in:
i-robot 2022-07-05 12:25:27 +00:00 committed by Gitee
commit a518be8eb8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 8 additions and 4 deletions
docs/api/api_python/mindspore
mindspore/python/mindspore/common

View File

@ -995,17 +995,21 @@ mindspore.Tensor
计算Tensor中每个元素的 `power` 次幂。
.. math::
out_{i} = x_{i} ^{ y_{i}}
.. note::
- Tensor和 `power` 遵循 `隐式类型转换规则 <https://www.mindspore.cn/docs/zh-CN/master/note/operator_list_implicit.html>`_ ,使数据类型保持一致。
- 当 `power` 是Tensor时它们的数据类型不能同时是bool并保证其shape可以广播。
- 当前的Tensor和`power`的数据类型不能同时是bool并保证其shape可以广播。
**参数:**
- **power** (Union[Tensor, number.Number, bool]) - 幂值是一个number.Number或bool值或数据类型为number或bool的Tensor。
- **power** (Union[Tensor, number.Number, bool]) - 幂值是一个number.Number或bool值或数据类型为number或bool_的Tensor。
**返回:**
Tensorshape与广播后的shape相同数据类型为Tensor与幂值中精度较高的类型。
Tensorshape与广播后的shape相同数据类型为`Tensor``power`中精度较高的类型。
**异常:**

View File

@ -1352,7 +1352,7 @@ class Tensor(Tensor_):
Returns:
Tensor, the shape is the same as the one after broadcasting,
and the data type is the one with higher precision or higher digits among `Tensor` and `power`.
and the data type is the one with higher precision or higher digits among `Tensor` and `power`.
Raises:
TypeError: If `power` is not one of the following: Tensor, number.Number or bool.