[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Performs two-dimensional and three-dimensional convolution for per-channel quantization. The convolution process is the same as that of aclnnConvolution.

  • Formula: Assume that the input shape is (N,Cin,D,H,W)(N, C_{\text{in}}, D, H, W), the weight shape is (Cout,Cin,Kd,Kh,Kw)(C_{\text{out}}, C_{\text{in}}, K_d, K_h, K_w), the scale shape is (Cout)(C_{\text{out}}), the bias shape is CoutC_{\text{out}}, and the output shape is (N,Cout,Dout,Hout,Wout)(N, C_{\text{out}}, D_{\text{out}}, H_{\text{out}}, W_{\text{out}}), where NN indicates the batch size, CC indicates the number of channels, DD, HH, and WW indicate the depth, height, and width of the sample, respectively, and KdK_d, KhK_h, and KwK_w indicate the depth, height, and width of the convolution kernel, respectively. Then, the output is expressed as follows:

    output(Ni,Coutj,Dout,Hout,Wout)=[k=0Cin1weight(Coutj,k)input(Ni,k)]×scale(Coutj)+bias(Coutj)\text{output}(N_i, C_{\text{out}_j}, D_{\text{out}}, H_{\text{out}}, W_{\text{out}}) = \left[\sum_{k = 0}^{C_{\text{in}} - 1} \text{weight}(C_{\text{out}_j}, k) \star \text{input}(N_i, k)\right] \times \text{scale}(C_{\text{out}_j}) + \text{bias}(C_{\text{out}_j})

    where \star indicates convolution compute, which is based on dimension of the convolution input and the convolution type (atrous convolution or group convolution). NN indicates the batch size, CC indicates the number of channels, and DD, HH, and WW indicate the depth, height, and width, respectively. The formulas for computing the corresponding output dimensions are as follows:

    Dout=[(D+2×padding[0]dilation[0]×(Kd1)1)/stride[0]]+1Hout=[(H+2×padding[1]dilation[1]×(Kh1)1)/stride[1]]+1Wout=[(W+2×padding[2]dilation[2]×(Kw1)1)/stride[2]]+1D_{\text{out}}=[(D + 2 \times padding[0] - dilation[0] \times (K_d - 1) - 1 ) / stride[0]] + 1 \\ H_{\text{out}}=[(H + 2 \times padding[1] - dilation[1] \times (K_h - 1) - 1 ) / stride[1]] + 1 \\ W_{\text{out}}=[(W + 2 \times padding[2] - dilation[2] \times (K_w - 1) - 1 ) / stride[2]] + 1
[object Object]

Each operator has calls. First, aclnnQuantConvolutionGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnQuantConvolution is called to perform computation.

[object Object]
[object Object]
[object Object]
  • Parameters:

    [object Object]
  • Returns:

    aclnnStatus: status code. For details, see .

    The first-phase API implements input parameter verification. The following errors may be thrown:

    [object Object]
[object Object]
  • Parameters:

    [object Object]
  • Returns:

    aclnnStatus: status code. For details, see .

[object Object]
  • Deterministic compute

    • aclnnQuantConvolution defaults to a deterministic implementation.
    [object Object]
[object Object]

The following example is for reference only. For details, see . For different product models, use different main functions.

[object Object]
  • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]:
[object Object]