[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Implements convolution operations, supporting 2D, deformable, and grouped convolutions.

  • Formula:

    Assume that the input tensor (input) has shape [N, inC, inH, inW] and the output tensor (out) has shape [N, outC, outH, outW]. The output height (outH) and width (outW) are computed as:

    outH=(inH+padding[0]+padding[1]((KH1)dilation[2]+1))//stride[2]+1outH = (inH + padding[0] + padding[1] - ((K_H - 1) * dilation[2] + 1)) // stride[2] + 1 outW=(inW+padding[2]+padding[3]((KW1)dilation[3]+1))//stride[3]+1outW = (inW + padding[2] + padding[3] - ((K_W - 1) * dilation[3] + 1)) // stride[3] + 1

    For standard convolution, the sampling coordinates are:

    x=padding[2]+owstride[3]+kwdilation[3],kw(0,K_W1)x = -padding[2] + ow*stride[3] + kw*dilation[3], kw ∈ (0, K\_W – 1) y=padding[0]+ohstride[2]+khdilation[2],kh(0,K_H1)y = -padding[0] + oh*stride[2] + kh*dilation[2], kh ∈ (0, K\_H – 1)

    For deformable convolution with the given offset, the deformed coordinates are:

    (x,y)=(x+offsetX,y+offsetY)(x,y) = (x + offsetX, y + offsetY)

    The value at the deformed location is computed using bilinear interpolation:

    (x0,y0)=(int(x),int(y))(x1,y1)=(x0+1,y0+1)(x_{0}, y_{0}) = (int(x), int(y)) \\ (x_{1}, y_{1}) = (x_{0} + 1, y_{0} + 1) weight00=(x1x)(y1y)weight01=(x1x)(yy0)weight10=(xx0)(y1y)weight11=(xx0)(yy0)weight_{00} = (x_{1} - x) * (y_{1} - y) \\ weight_{01} = (x_{1} - x) * (y - y_{0}) \\ weight_{10} = (x - x_{0}) * (y_{1} - y) \\ weight_{11} = (x - x_{0}) * (y - y_{0}) \\ deformOut(x,y)=weight00input(x0,y0)+weight01input(x0,y1)+weight10input(x1,y0)+weight11input(x1,y1)deformOut(x, y) = weight_{00} * input(x0, y0) + weight_{01} * input(x0,y1) + weight_{10} * input(x1, y0) + weight_{11} * input(x1,y1)

    The final convolution output is given by:

    out(Ni,Coutj)=bias(Coutj)+k=0Cin1weight(Coutj,k)deformOut(Ni,k)\text{out}(N_i, C_{\text{out}_j}) = \text{bias}(C_{\text{out}_j}) + \sum_{k = 0}^{C_{\text{in}} - 1} \text{weight}(C_{\text{out}_j}, k) \star \text{deformOut}(N_i, k)
[object Object]

Each operator has calls. First, aclnnDeformableConv2dGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation flow. Then, aclnnDeformableConv2d 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 verification. The following errors may be thrown.

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns

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

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

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

[object Object]