Description: Performs sigmoid calculation on input x during MoE calculation, sorts the calculation results by group, and selects the top k experts based on the group sorting result.
Formula:
Computes sigmoid of the input element-wise.
Add addNum:
Group the computation results based on
[object Object], sort each group based on the sum value of top N, and select the first[object Object]groups.Obtain the corresponding element in
[object Object]based on the[object Object]obtained in the previous step, and perform topK on the data to obtain the indices result.Select
[object Object]from[object Object]based on indices.If
[object Object]is[object Object],[object Object]is computed based on the input scale parameter to obtain the result of[object Object].If
[object Object]is[object Object], the physical experts in indices are mapped to logical experts based on the input[object Object]and[object Object]to obtain the output indices.
Each operator consists of . You must first call the [object Object] API to obtain the required workspace size and the executor that contains the operator computation flow, and then call the [object Object] API to execute the 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 a deterministic implementation.
[object Object]must be an integer multiple of[object Object].[object Object]must be less than or equal to[object Object].[object Object]must be less than or equal to 128.[object Object]must be less than or equal to[object Object].[object Object]must be less than or equal to[object Object]/[object Object].[object Object]must be less than or equal to 1024.[object Object]must be less than or equal to 256.
The following example is for reference only. For details, see .