- Operator function: Uses each element of
[object Object]as the power of the corresponding element of[object Object]to complete the computation. - Formula:
Operator restrictions: If INT32 computation is performed beyond the following ranges, timeout occurs.
[object Object]undefined
aclnnPowTensorScalar and aclnnInplacePowTensorScalar implement the same function in different ways. Select a proper operator based on your requirements.
- aclnnPowTensorScalar: An output tensor object needs to be created to store the computation result.
- aclnnInplacePowTensorScalar: No output tensor object needs to be created, and the computation result is stored in the memory of the input tensor.
Each operator has calls. First, aclnnPowTensorScalarGetWorkspaceSize or aclnnInplacePowTensorScalarGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnPowTensorScalar or aclnnInplacePowTensorScalar is called to perform computation.
[object Object][object Object][object Object][object Object]
Parameters:
[object Object](aclTensor*, compution input):[object Object]in the formula, aclTensor on the device. are supported. The shape must be the same as that of[object Object]. The can be ND.- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: The data type can be FLOAT, FLOAT16, DOUBLE, INT32, INT64, BOOL, INT8, UINT8, INT16, COMPLEX64, COMPLEX128, or BFLOAT16, and must meet the with
[object Object]. - [object Object]Atlas training products[object Object], [object Object]Atlas 200I/500 A2 inference products[object Object], and [object Object]Atlas inference products[object Object]: The data type can be FLOAT, FLOAT16, DOUBLE, INT32, INT64, BOOL, INT8, UINT8, INT16, COMPLEX64, or COMPLEX128, and must meet the with
[object Object].
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: The data type can be FLOAT, FLOAT16, DOUBLE, INT32, INT64, BOOL, INT8, UINT8, INT16, COMPLEX64, COMPLEX128, or BFLOAT16, and must meet the with
[object Object](aclScalar*, compution input):[object Object]in the formula, aclScalar on the device. The data type cannot be BOOL at the same time as[object Object]. If the data type of[object Object]and[object Object]is integer after deduction, the value of[object Object]must be greater than or equal to 0. The value of[object Object]must be within the value range of the data type after deduction of[object Object]and[object Object].- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: The data type can be FLOAT, FLOAT16, DOUBLE, INT32, INT64, BOOL, INT8, UINT8, INT16, COMPLEX64, COMPLEX128, or BFLOAT16, and must meet the with
[object Object]. - [object Object]Atlas training products[object Object], [object Object]Atlas 200I/500 A2 inference products[object Object], and [object Object]Atlas inference products[object Object]: The data type can be FLOAT, FLOAT16, DOUBLE, INT32, INT64, BOOL, INT8, UINT8, INT16, COMPLEX64, or COMPLEX128, and must meet the with
[object Object].
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: The data type can be FLOAT, FLOAT16, DOUBLE, INT32, INT64, BOOL, INT8, UINT8, INT16, COMPLEX64, COMPLEX128, or BFLOAT16, and must meet the with
[object Object](aclTensor*, computation output):[object Object]in the formula, aclTensor on the device. are supported. The shape must be the same as that of self. The data type must be convertible from that after deduction between self and exponent (for details, see ). The supports ND.- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: The supported data types are FLOAT, FLOAT16, DOUBLE, INT32, INT64, BOOL, INT8, UINT8, INT16, COMPLEX64, COMPLEX128, and BFLOAT16.
- [object Object]Atlas training products[object Object], [object Object]Atlas 200I/500 A2 inference products[object Object], and [object Object]Atlas inference products[object Object]: The supported data types are FLOAT, FLOAT16, DOUBLE, INT32, INT64, BOOL, INT8, UINT8, INT16, COMPLEX64, and COMPLEX128.
[object Object](uint64_t*, output): size of the workspace to be allocated on the device.[object Object](aclOpExecutor**, output): operator executor, containing the operator computation process.
Returns
Parameters:
[object Object](void*, input): address of the workspace to be allocated on the device.[object Object](uint64_t, input): size of the workspace to be allocated on the device, which is obtained by the first-phase API aclnnPowTensorScalarGetWorkspaceSize.[object Object](aclOpExecutor*, input): operator executor, containing the operator computation process.[object Object](aclrtStream, input): stream for executing the task.
Returns
Parameters:
[object Object](aclTensor*): input[object Object]in the formula, aclTensor on the device. The data type must be convertible from that after deduction with that of[object Object](see ). are supported. The supports ND.- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: The supported data types are FLOAT, FLOAT16, DOUBLE, INT32, INT64, INT8, UINT8, COMPLEX64, COMPLEX128, INT16, and BFLOAT16, and the data type must satisfy the with that of
[object Object]. - [object Object]Atlas training products[object Object], [object Object]Atlas 200I/500 A2 inference products[object Object], and [object Object]Atlas inference products[object Object]: The supported data types are FLOAT, FLOAT16, DOUBLE, INT32, INT64, INT8, UINT8, COMPLEX64, COMPLEX128, and INT16, and the data type must meet the with
[object Object].
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: The supported data types are FLOAT, FLOAT16, DOUBLE, INT32, INT64, INT8, UINT8, COMPLEX64, COMPLEX128, INT16, and BFLOAT16, and the data type must satisfy the with that of
[object Object](aclScalar*, compution input): input[object Object]in the formula,[object Object]on the device. If the data type of[object Object]and[object Object]is integer after deduction, the value of[object Object]must be greater than or equal to 0. The value of[object Object]must be within the value range of the data type after deduction of[object Object]and[object Object].- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: The supported data types are FLOAT, FLOAT16, DOUBLE, INT32, INT64, INT8, UINT8, COMPLEX64, COMPLEX128, INT16, and BFLOAT16, and the data type must satisfy the with that of
[object Object]. - [object Object]Atlas training products[object Object], [object Object]Atlas 200I/500 A2 inference products[object Object], and [object Object]Atlas inference products[object Object]: The supported data types are FLOAT, FLOAT16, DOUBLE, INT32, INT64, INT8, UINT8, COMPLEX64, COMPLEX128, and INT16, and the data type must meet the with
[object Object].
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: The supported data types are FLOAT, FLOAT16, DOUBLE, INT32, INT64, INT8, UINT8, COMPLEX64, COMPLEX128, INT16, and BFLOAT16, and the data type must satisfy the with that of
[object Object](uint64_t*, output): size of the workspace to be allocated on the device.[object Object](aclOpExecutor**, output): operator executor, containing the operator computation process.
Returns
Parameters:
[object Object](void*, input): address of the workspace to be allocated on the device.[object Object](uint64_t, input): size of the workspace to be allocated on the device, which is obtained by the first-phase API aclnnInplacePowTensorScalarGetWorkspaceSize.[object Object](aclOpExecutor*, input): operator executor, containing the operator computation process.[object Object](aclrtStream, input): stream for executing the task.
Returns
- Deterministic computation:
- aclnnPowTensorScalar and aclnnInplacePowTensorScalar default to deterministic implementation.
[object Object]Atlas training products[object Object] and [object Object]Atlas inference products[object Object]: If the computation result exceeds the value range of the specified data type, the boundary value of the data type is returned as the result.
In the exponent = 2 scenario, when the [object Object] operator is called and the input [object Object] is [object Object], the accuracy is ensured only when the result is within the range of (-2048, 1920).
The following examples are for reference only. For details, see .