[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Implements convolution operations, supporting 1D, 2D, and 3D convolutions, as well as transposed convolution, dilated convolution, and grouped convolution. When [object Object], the operator performs transposed convolution (also known as fractionally-strided convolution). This can be viewed as the gradient or inverse operation of regular convolution: it maps the output shape back to the input shape while maintaining a connection pattern compatible with convolution. Its parameters are similar to those of regular convolution, including input channels, output channels, kernel size, stride, padding, output padding, groups, bias, and dilation.

  • Formula:

    Assume the input tensor has shape (N,Cin,D,H,W)(N, C_{\text{in}}, D, H, W), the weight tensor has shape (Cout,Cin,Kd,Kh,Kw)(C_{\text{out}}, C_{\text{in}}, K_d, K_h, K_w), and the output tensor has shape (N,Cout,Dout,Hout,Wout)(N, C_{\text{out}}, D_{\text{out}}, H_{\text{out}}, W_{\text{out}}), where NN denotes the batch size, CC denotes the number of channels, DD, HH, and WW denote the depth, height, and width of the sample respectively, and KdK_d, KhK_h, and KwK_w denote the depth, height, and width of the kernel respectively. The output is then expressed as:

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

    Where \star denotes the convolution operation, whose exact computation depends on the input dimensionality and the convolution type (dilated or grouped). NN denotes the batch size, CC denotes the number of channels, and DD, HH, and WW denote the depth, height, and width, respectively. The formulas for computing the corresponding output dimensions are as follows:

    • When [object Object]:

      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
    • When [object Object]:

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

Each operator has [object Object]two-phase API calls[object Object]. You must call aclnnConvolutionGetWorkspaceSize to obtain the workspace size required for computation and the executor that contains the operator computation process, and then call aclnnConvolution to perform the computation.

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

    [object Object]
  • Return Value

    aclnnStatus: status code. For details, see [object Object]aclnn Return Codes[object Object].

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

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Return Value

    aclnnStatus: return status code. For details, see [object Object]aclnn Return Codes[object Object].

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

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

[object Object]