[object Object][object Object][object Object]undefined
[object Object]
  • Description: The DenseLightningIndexerSoftmaxLse operator is a branch operator for the DenseLightningIndexerGradKlLoss operator to compute the Softmax input.

  • Formulas:

    res=AttentionMask(ReduceSum(WReLU(Qindex@KindexT)))\text{res}=\text{AttentionMask}\left(\text{ReduceSum}\left(W\odot\text{ReLU}\left(Q_{index}@K_{index}^T\right)\right)\right) maxIndex=max(res)\text{maxIndex}=\text{max}\left(res\right) sumIndex=ReduceSum(exp(resmaxIndex))\text{sumIndex}=\text{ReduceSum}\left(\text{exp}\left(res-maxIndex\right)\right)

    maxIndex and sumIndex are transferred to the DenseLightningIndexerGradKlLoss operator as inputs for calculating Softmax.

[object Object]

Each operator has calls. First, [object Object] is called to obtain the input parameters and compute the required workspace size based on the 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 validation. The following error codes may be returned.

    [object Object]
[object Object]
  • Parameters:

    [object Object]
  • Returns

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

[object Object]
  • The data types of the queryIndex and keyIndex parameters must be the same.

  • If the weights parameter is not of type float32, the data types of the queryIndex, keyIndex, and weights parameters must be the same.

  • Deterministic computation: The default deterministic implementation of aclnnDenseLightningIndexerSoftmaxLse is used.

  • Common constraints

    • Processing when the input parameter is empty:
      • If queryIndex is an empty tensor, the function returns directly.
      • The scenarios where the input parameters are empty in the SFAG common restrictions are the same as those in the FAG.
    [object Object]
  • Constraints

    [object Object]
  • Typ.

    [object Object]
[object Object]

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

[object Object]