Merged
docs(pow): 纠正公式、参数及非连续输出标注 #6338
zhang-song-ruiAdd on 27 days ago
docs(pow): 纠正公式、参数及非连续输出标注 #6338
Merged
Merged fromzhang-song-rui/ops-math--powziliaomasterintocann/ops-mathmaster
Total: 4 files changed+12-12
| @@ -25,12 +25,12 @@ | |||
| 25 | 25 | ||
| 26 | ## 功能说明 | 26 | ## 功能说明 |
| 27 | 27 | ||
| 28 | -- 接口功能:exponent每个元素作为input对应元素的幂完成计算。 | 28 | +- 接口功能:以标量self为底数,逐元素计算self的exponent次幂。 |
| 29 | 29 | ||
| 30 | - 计算公式: | 30 | - 计算公式: |
| 31 | 31 | ||
| 32 | $$ | 32 | $$ |
| 33 | -out_i = x_i^{exponent_i} | 33 | +out_i = self^{exponent_i} |
| 34 | $$ | 34 | $$ |
| 35 | 35 | ||
| 36 | - 算子约束:INT32整型计算在如下范围以外的场景,会出现超时。 | 36 | - 算子约束:INT32整型计算在如下范围以外的场景,会出现超时。 |
| @@ -93,7 +93,7 @@ aclnnStatus aclnnPowScalarTensor( | |||
| 93 | <tr> | 93 | <tr> |
| 94 | <td>self(aclScalar*)</td> | 94 | <td>self(aclScalar*)</td> |
| 95 | <td>输入</td> | 95 | <td>输入</td> |
| 96 | - <td>pow运算中的底数,公式中的x</td> | 96 | + <td>pow运算中的标量底数,公式中的self</td> |
| 97 | <td>数据类型与exponent满足<a href ="../../../docs/zh/context/deduction_relationship.md">TensorScalar互推导关系</a>。</td> | 97 | <td>数据类型与exponent满足<a href ="../../../docs/zh/context/deduction_relationship.md">TensorScalar互推导关系</a>。</td> |
| 98 | <td>FLOAT、FLOAT16、DOUBLE、INT16、INT32、INT64、INT8、UINT8、BOOL、COMPLEX64、COMPLEX128、BFLOAT16</td> | 98 | <td>FLOAT、FLOAT16、DOUBLE、INT16、INT32、INT64、INT8、UINT8、BOOL、COMPLEX64、COMPLEX128、BFLOAT16</td> |
| 99 | <td>-</td> | 99 | <td>-</td> |
| @@ -111,7 +111,7 @@ aclnnStatus aclnnPowScalarTensor( | |||
| 111 | <td>√</td> | 111 | <td>√</td> |
| 112 | </tr> | 112 | </tr> |
| 113 | <tr> | 113 | <tr> |
| 114 | - <td>out(aclTensor*)</td> | 114 | + <td>out(const aclTensor*)</td> |
| 115 | <td>输出</td> | 115 | <td>输出</td> |
| 116 | <td>pow运算中的指数输出,公式中的out</td> | 116 | <td>pow运算中的指数输出,公式中的out</td> |
| 117 | <td>数据类型需要是self的数据类型与exponent的数据类型推导之后可转换的数据类型(参见<a href ="../../../docs/zh/context/conversion_relationship.md">互转换关系</a>)。</td> | 117 | <td>数据类型需要是self的数据类型与exponent的数据类型推导之后可转换的数据类型(参见<a href ="../../../docs/zh/context/conversion_relationship.md">互转换关系</a>)。</td> |
| @@ -30,7 +30,7 @@ | |||
| 30 | - 计算公式: | 30 | - 计算公式: |
| 31 | 31 | ||
| 32 | $$ | 32 | $$ |
| 33 | - out_i = self_i^{exponent_i} | 33 | + out_i = self_i^{exponent} |
| 34 | $$ | 34 | $$ |
| 35 | 35 | ||
| 36 | ## 函数原型 | 36 | ## 函数原型 |
| @@ -130,7 +130,7 @@ aclnnStatus aclnnInplacePowTensorScalar( | |||
| 130 | <td>FLOAT、FLOAT16、DOUBLE、BOOL、INT16、INT32、INT64、INT8、UINT8、COMPLEX64、COMPLEX128、BFLOAT16、UINT16、UINT32、UINT64</td> | 130 | <td>FLOAT、FLOAT16、DOUBLE、BOOL、INT16、INT32、INT64、INT8、UINT8、COMPLEX64、COMPLEX128、BFLOAT16、UINT16、UINT32、UINT64</td> |
| 131 | <td>ND</td> | 131 | <td>ND</td> |
| 132 | <td>-</td> | 132 | <td>-</td> |
| 133 | - <td>-</td> | 133 | + <td>√</td> |
| 134 | </tr> | 134 | </tr> |
| 135 | <tr> | 135 | <tr> |
| 136 | <td>workspaceSize(uint64_t*)</td> | 136 | <td>workspaceSize(uint64_t*)</td> |
| @@ -21,14 +21,14 @@ extern "C" { | |||
| 21 | * @brief aclnnPowTensorTensor的第一段接口,根据具体的计算流程,计算workspace大小。 | 21 | * @brief aclnnPowTensorTensor的第一段接口,根据具体的计算流程,计算workspace大小。 |
| 22 | * @domain aclnn_math | 22 | * @domain aclnn_math |
| 23 | * @param [in] self: npu device侧的aclTensor,数据类型支持FLOAT、FLOAT16、BFLOAT16、DOUBLE、INT32、INT64、 | 23 | * @param [in] self: npu device侧的aclTensor,数据类型支持FLOAT、FLOAT16、BFLOAT16、DOUBLE、INT32、INT64、 |
| 24 | - * INT16、INT8、UINT8、BOOL、COMPLEX64、COMPLEX128,且数据类型需要与other构成互相推导关系,shape需要与other满足broadcast关系。 | 24 | + * INT16、INT8、UINT8、BOOL、COMPLEX64、COMPLEX128,且数据类型需要与exponent构成互相推导关系,shape需要与exponent满足broadcast关系。 |
| 25 | - * 支持非连续的Tensor,数据格式支持ND,且数据格式需要与other一致。 | 25 | + * 支持非连续的Tensor,数据格式支持ND,且数据格式需要与exponent一致。 |
| 26 | * @param [in] exponent: npu device侧的aclTensor,数据类型支持FLOAT、FLOAT16、BFLOAT16、DOUBLE、INT32、 | 26 | * @param [in] exponent: npu device侧的aclTensor,数据类型支持FLOAT、FLOAT16、BFLOAT16、DOUBLE、INT32、 |
| 27 | * INT64、INT16、INT8、UINT8、BOOL、COMPLEX64、COMPLEX128,且数据类型需要与self构成互相推导关系,shape需要与self满足broadcast关系。 | 27 | * INT64、INT16、INT8、UINT8、BOOL、COMPLEX64、COMPLEX128,且数据类型需要与self构成互相推导关系,shape需要与self满足broadcast关系。 |
| 28 | * 支持非连续的Tensor,数据格式支持ND,且数据格式需要与self一致。 | 28 | * 支持非连续的Tensor,数据格式支持ND,且数据格式需要与self一致。 |
| 29 | * @param [in] out: npu device侧的aclTensor,数据类型支持FLOAT、FLOAT16、BFLOAT16、DOUBLE、INT32、INT64、 | 29 | * @param [in] out: npu device侧的aclTensor,数据类型支持FLOAT、FLOAT16、BFLOAT16、DOUBLE、INT32、INT64、 |
| 30 | - * INT16、INT8、UINT8、BOOL、COMPLEX64、COMPLEX128,且数据类型需要是self与other推导之后可转换的数据类型, | 30 | + * INT16、INT8、UINT8、BOOL、COMPLEX64、COMPLEX128,且数据类型需要是self与exponent推导之后可转换的数据类型, |
| 31 | - * shape为self与other两者broadcast之后的shape,数据格式支持ND,且数据格式需要与self一致。 | 31 | + * shape为self与exponent两者broadcast之后的shape,数据格式支持ND,且数据格式需要与self一致。 |
| 32 | * @param [out] workspaceSize: 返回用户需要在npu device侧申请的workspace大小。 | 32 | * @param [out] workspaceSize: 返回用户需要在npu device侧申请的workspace大小。 |
| 33 | * @param [out] executor: 返回op执行器,包含算子计算流程。 | 33 | * @param [out] executor: 返回op执行器,包含算子计算流程。 |
| 34 | * @return aclnnStatus: 返回状态码。 | 34 | * @return aclnnStatus: 返回状态码。 |
| @@ -27,10 +27,10 @@ namespace ge { | |||
| 27 | * Two inputs, including: | 27 | * Two inputs, including: |
| 28 | * @li x1: A ND Tensor. Must be one of the following types: | 28 | * @li x1: A ND Tensor. Must be one of the following types: |
| 29 | * bfloat16, float16, float32, int32, int64, int8, int16, uint8, double, complex64, complex128. | 29 | * bfloat16, float16, float32, int32, int64, int8, int16, uint8, double, complex64, complex128. |
| 30 | -* @li x2: A ND Tensor of the same dtype as "x1". \n | 30 | +* @li x2: A ND Tensor. Supports the same dtype set as "x1"; its dtype may differ from "x1". \n |
| 31 | 31 | ||
| 32 | * @par Outputs: | 32 | * @par Outputs: |
| 33 | -* y: A ND Tensor. Has the same dtype as "x1". \n | 33 | +* y: A ND Tensor. Its dtype is inferred by promoting the dtypes of "x1" and "x2". \n |
| 34 | 34 | ||
| 35 | * @par Third-party framework compatibility | 35 | * @par Third-party framework compatibility |
| 36 | * Compatible with the TensorFlow operator Pow. | 36 | * Compatible with the TensorFlow operator Pow. |