[object Object][object Object][object Object]undefined
[object Object]

Operator description: Extracts sliding local blocks from a batched input tensor and combines an array of sliding local blocks into a large tensor.

Consider a batched input tensor with shape (N,C,)(N,C,∗), where NN is the batch dimension, CC is the channel dimension, and indicates any spatial dimension.

This operation flattens each sliding kernel_size block in the input spatial dimension into a column (that is, the last dimension) which is a 3D output tensor with shape (N,C×(kernelsize),L)(N,C×\prod(kernel_size),L).

Where C×(kernelsize)C×\prod(kernel_size) is the number of values in each block (a block has (kernelsize)\prod (kernel_size) spatial positions, each containing a CC channel vector), and LL is the total number of these blocks:

L=dspatialsize[d]+2×padding[d]dilation[d]×(kernelsize[d]1)1stride[d]+1L=\prod_d⌊{\frac{spatial_size[d]+2×padding[d]−dilation[d]×(kernel_size[d]−1)−1}{stride[d]}+1}⌋

spatial_size consists of the spatial dimensions of input ( above), and dd covers all spatial dimensions. Therefore, in the last dimension (column) index, the output gives all values in a block.

[object Object]

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

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

    • gradOutput (aclTensor*, compute input): output tensor in the formula. The shape is (C×(kernelsize),L)(C×\prod(kernel_size),L) or (N,C×(kernelsize),L)(N,C×\prod(kernel_size),L). aclTensor on the device. The shape can be 2-dimensional or 3-dimensional. are supported. The can be ND.
      • [object Object]Atlas training products[object Object]: The data type can be FLOAT16 or FLOAT.
      • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object], [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: The data type can be BFLOAT16, FLOAT16, or FLOAT.
    • inputSize (aclIntArray*, compute input): spatialsizespatial_size in the formula, aclIntArray on the host, shape of the input tensor. The size is 2 and the data type is int64.
    • kernelSize (aclIntArray*, compute input): kernelsizekernel_size in the formula, aclIntArray on the host, size of the convolution kernel. The size is 2 and the data type is int64.
    • dilation (aclIntArray*, compute input): dilationdilation in the formula, aclIntArray on the host, dilatation parameter. The size is 2 and the data type is int64.
    • padding (aclIntArray*, compute input): paddingpadding in the formula, aclIntArray on the host, padding size of the convolution. The size is 2 and the data type is int64.
    • stride (aclIntArray*, compute input): stridestride in the formula, aclIntArray on the host. The size is 2 and the data type is int64.
    • out (aclTensor*, compute output): input tensor in the formula. The shape is (C,spatialsize[0],spatialsize[1])(C,spatial_size[0],spatial_size[1]) or (N,C,spatialsize[0],spatialsize[1])(N,C,spatial_size[0],spatial_size[1]). aclTensor on the device. The shape can be 3D (2D for gradOutput) or 4D (3D for gradOutput). are supported. The can be ND.
      • [object Object]Atlas training products[object Object]: The data type can be FLOAT16 or FLOAT.
      • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object], [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: The data type can be BFLOAT16, FLOAT16, or FLOAT.
    • workspaceSize (uint64_t*, output): size of the workspace to be allocated on the device.
    • executor (aclOpExecutor**, output): operator executor, containing the operator computation process.
  • Returns:

    aclnnStatus: status code. For details, see .

[object Object]
[object Object]
  • Parameters:

    • workspace (void*, input): address of the workspace to be allocated on the device.
    • workspaceSize (uint64_t, input): size of the workspace to be allocated on the device, which is obtained by calling the first-phase API aclnnIm2colBackwardGetWorkspaceSize.
    • executor (aclOpExecutor*, input): operator executor, containing the operator computation process.
    • stream (aclrtStream, input): stream for executing the task.
  • Returns:

    aclnnStatus: status code. For details, see .

[object Object]

None

[object Object]

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

[object Object]