[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: If [object Object] = 0, performs the Softmax operation on the output of [object Object] before obtaining the topK value. If renorm = 1, performs the Softmax operation on the output of [object Object] after obtaining the topK value. [object Object] is the topK result of softmax. [object Object] is the index result of the topK value, that is, the corresponding expert sequence number. If the corresponding row finished is [object Object], the expert sequence number is directly filled with the value of [object Object] (that is, the size of the last axis of [object Object]).

  • Formula:

    1. renorm = 0,

      softmaxResultOutOptional=softmax(x,axis=1)softmaxResultOutOptional=softmax(x,axis=-1) yOut,expertIdxOut=topK(softmaxResultOutOptional,k=k)yOut,expertIdxOut=topK(softmaxResultOutOptional,k=k)
    2. renorm = 1

      topkOut,expertIdxOut=topK(x,k=k)topkOut,expertIdxOut=topK(x, k=k) yOut=softmax(topkOut,axis=1)yOut = softmax(topkOut,axis=-1)
[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 performs input parameter validation. The following errors may be returned:

    [object Object]
[object Object]
  • Parameters:

    [object Object]
  • Returns

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

[object Object]
  • Deterministic computation:
    • [object Object] defaults to a deterministic implementation.
[object Object]

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

[object Object]