Description: Performs permute computation of MoE, and broadcasts and sorts tokens based on indices.
Formula:
When paddedMode is set to false, the formula is as follows. In the formula, topK indicates the number of experts selected by a token. When the dimension of Indices is 2, the value is equal to the size of the last dimension of Indices. When the dimension of Indices is 1, the value of topK is 1.
When paddedMode is set to true (not supported currently):
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.
The following example is for reference only. For details, see .