[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Performs routing on the computation result of .
  • Formula: Flattens the input expertIdx with shape [NUM_ROWS, K] into a row for sorting. NUM_ROWS indicates the number of input tokens, and K indicates the number of experts selected by the tokens.expandedExpertIdxOut,sortedRowIdx=keyValueSort(expertIdx,rowIdx)expandedExpertIdxOut,sortedRowIdx=keyValueSort(expertIdx,rowIdx) expandedRowIdxOut[sortedRowIdx[i]]=iexpandedRowIdxOut[sortedRowIdx[i]]=i expandedXOut[i]=x[sortedRowIdx[i]%NUMROWS]expandedXOut[i]=x[sortedRowIdx[i]\%NUM_ROWS]
[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 an element in [object Object] must be greater than -2**24 and less than or equal to 2**24. Otherwise, precision issues may occur.
[object Object]

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

[object Object]