[object Object]

[object Object][object Object]undefined
[object Object]
  • Operator function: performs the attention calculation in the Swin-transformer scenario. Compared with the SwinAttentionScore operator, this operator supports int8 quantization.
  • Formulas:
out=Softmax(QKT+bias1+bias2)Vout= Softmax(QK^T + bias1 + bias2)V [object Object]

Each operator has calls. First, aclnnSwinAttentionScoreQuantGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnSwinAttentionScoreQuant 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]
  • When the QKV input dimension is [N, C, S, H], S <= 1024, H = 32/64, and the NC dimension can be any value.
  • The input of the QKV transpose with the dimension [N, C, S, H] is not supported.
  • Only asymmetric quantization is supported.
  • Bias2 is not supported.
  • Only the softmax operation can be performed on the last dimension of QK^T + bias1 + bias2.
[object Object]

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

[object Object]