Description: Performs element-wise multiplication between each tensor in the input tensor list and the given scalar scalar. Compared with , this API modifies the structure type of the input parameter scalar from aclTensor to aclScalar. Select the appropriate API based on actual requirements.
Formula:
Each operator has calls. First, [object Object] is called to obtain the input parameters and compute the required workspace size based on the process. Then, [object Object] is called to perform computation.
Parameters
[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 of
[object Object]depends on that of[object Object]:- When
[object Object]is of the FLOAT32 or BFLOAT16 type,[object Object]must be FLOAT32 or DOUBLE. - When
[object Object]is of the FLOAT16 type,[object Object]must be FLOAT16 or DOUBLE. - When
[object Object]is of the INT32 type,[object Object]must be INT32 or INT64.
- When
Ascend 950PR/Ascend 950DT:
- Both the input parameter
[object Object]and the output parameter[object Object]support a maximum of 50 tensors. - The data type of
[object Object]depends on that of[object Object]:- When
[object Object]is of type BFLOAT16 or FLOAT32,[object Object]can be of type FLOAT32 or DOUBLE. - When x is of the FLOAT16 type, scalar must be FLOAT16, FLOAT32, or DOUBLE.
- When
[object Object]is of the INT32 type,[object Object]must be INT32 or INT64.
- When
- Both the input parameter
Returns
[object Object]: status code. For details, see .The first-phase API implements input parameter verification. The following errors may be thrown.
[object Object]
- Deterministic computation:
- aclnnForeachMulScalarV2 defaults to a deterministic implementation.
The following example is for reference only. For details, see .