Description: Obtains the input data of permutedTokens based on sortedIndices. If probs data exists, permutedTokens is multiplied by probs. Then, computes the cumulative sum and outputs the computation result.
Formulas:
If
[object Object]is not set to[object Object], the formula is as follows:where ; ; ;
[object Object]indicates[object Object];[object Object]indicates[object Object];[object Object]indicates[object Object];[object Object]indicates[object Object];[object Object]indicates[object Object];[object Object]indicates[object Object].If
[object Object]is set to[object Object],[object Object]is[object Object]. The formula is as follows:where ;
[object Object]indicates[object Object];[object Object]indicates[object Object];[object Object]indicates[object Object];[object Object]indicates[object Object].
Each operator has calls. First, [object Object] is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, [object Object] is called to perform computation.
Parameters:
[object Object]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:
[object Object]defaults to deterministic implementation.
[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 value of
[object Object]is less than or equal to[object Object].Ascend 950PR/Ascend 950DT: When this API is called, the framework internally calls the API. If a parameter error message is displayed, see the following parameter mapping:
- The permutedTokens input is equivalent to the expandedX input of the aclnnMoeFinalizeRoutingV2 API.
- The sortedIndices input is equivalent to the expandedRowIdx input of the aclnnMoeFinalizeRoutingV2 API.
- The probsOptional input is equivalent to the scalesOptional input of the aclnnMoeFinalizeRoutingV2 API.
- The paddedMode input is equivalent to the dropPadMode input of the aclnnMoeFinalizeRoutingV2 API.
- The out output is equivalent to the out output of the aclnnMoeFinalizeRoutingV2 API.
[object Object]Atlas inference products[object Object]:
- The data types supported by
[object Object]and[object Object]are FLOAT16 and FLOAT32. - The value of
[object Object]is less than or equal to[object Object]. - hidden_size is a multiple of 128 and is less than 10240.
- The data types supported by
The following example is for reference only. For details, see .