[object Object]

[object Object][object Object]undefined
[object Object]
  • 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:

      T[k]=T[S[k]]T[k] = T[S[k]] T[k]=T[k]P[i][j]T[k] = T[k] * P[i][j] O[i]=k=itopK(i+1)topK1T[k]O[i] = \sum_{k=i*topK}^{(i+1)*topK - 1 } T[k]

      where i0,1,...,tokens1i \in {0,1,...,tokens-1}; j0,1,...,topK1j \in {0,1,...,topK-1}; k0,1,...,tokenstopK1k \in {0,1,...,tokens*topK-1}; [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:

      T[i]=T[S[i]]T[i] = T[S[i]] O[i]=T[i]O[i] = T[i]

      where i0,1,...,tokens1i \in {0,1,...,tokens-1}; [object Object] indicates [object Object]; [object Object] indicates [object Object]; [object Object] indicates [object Object]; [object Object] indicates [object Object].

[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.

[object Object]
[object Object]
[object Object]
  • 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]
[object Object]
  • Parameters:

    [object Object]
  • Returns:

    [object Object]: status code. For details, see .

[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.
[object Object]

The following example is for reference only. For details, see .

[object Object]