[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Obtains the input data in [object Object] based on the subscript positions stored in [object Object], multiplies the input data by [object Object], and accumulates the results.

  • Formula:

    sortedIndices=sortedIndices[rangeOptional[0]<=i<rangeOptional[1]]sortedIndices = sortedIndices[rangeOptional[0]<=i<rangeOptional[1]]

    (1) If [object Object] is not set to [object Object], the formula is as follows, where i0,1,2,...,num_tokens1i \in {0, 1, 2, ..., num\_tokens – 1}, j0,1,2,...,topK_num1j \in {0, 1, 2, ..., topK\_num – 1}, and k0,1,2,...,num_tokenstopK_numk \in {0, 1, 2, ..., num\_tokens * topK\_num}:

    permutedTokens=permutedTokens.indexSelect(0,sortedIndices)permutedTokens = permutedTokens.indexSelect(0, sortedIndices) permutedTokensk=permutedTokenskprobsi,jpermutedTokens_{k} = permutedTokens_{k} * probs_{i,j} outi=k=itopK_num(i+1)topK_num1permutedTokenskout_{i} = \sum_{k=i*topK\_num}^{(i+1)*topK\_num - 1 } permutedTokens_{k}

    (2) If [object Object] is set to [object Object], the formula is as follows, where i0,1,2,...,num_tokens1i \in {0, 1, 2, ..., num\_tokens – 1} and j0,1,2,...,topK_num1j \in {0, 1, 2, ..., topK\_num – 1}:

    permutedTokens=permutedTokens.indexSelect(0,sortedIndices)permutedTokens = permutedTokens.indexSelect(0, sortedIndices) outi=k=itopK_num(i+1)topK_num1permutedTokenskout_{i} = \sum_{k=i*topK\_num}^{(i+1)*topK\_num - 1 } permutedTokens_{k}
[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.
  • The value of [object Object] is less than or equal to [object Object].

  • [object Object] cannot be set to [object Object].

  • When [object Object] is left empty, [object Object] is ignored, and the execution logic is rolled back to .

[object Object]

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

[object Object]