[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Rearranges sliding image neighborhoods into column vectors, and concatenates them into large tensors. The sliding windows are extracted from the batch-processing input tensor. Consider a batch-processing input tensor whose shape is (N, C, H, W) or (C, H, W), where [object Object] is the batch-processing dimension, [object Object] is the channel dimension, and [object Object] and [object Object] indicate the image size. This operation flattens each sliding kernel_size block in the spatial dimension of the input to 3D of (N, C ×\times \prod (kernel_size), L) or column (the last dimension) of the 2D output tensor of (C ×\times \prod (kernel_size), L), where [object Object] is the total number of these blocks.
  • Formula: L=dspatialsize[d]+2×padding[d]dilation[d]×(kernelsize[d]1)1stride[d]+1L = \prod_{d} \lfloor \frac{spatial_size[d] + 2 \times padding[d] - dilation[d] \times (kernel_size[d] -1) -1}{stride[d]} + 1 \rfloor, where [object Object] consists of [object Object] and [object Object] of the input tensor.
[object Object]

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

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

    • [object Object] (aclTensor*, computation input): aclTensor on the device. The shape is 3- or 4-dimensional, and the data type can be FLOAT, FLOAT16, or BFLOAT16. are supported. The can be ND.
    • [object Object] (aclIntArray*, computation input): aclIntArray on the NPU host, size of the convolution kernel. The size is 2. The data type is INT64.
    • [object Object] (aclIntArray*, computation input): aclIntArray on the NPU host, dilation parameter. The size is 2. The data type is INT64.
    • [object Object] (aclIntArray*, computation input): aclIntArray on the NPU host, convolutional padding size. The size is 2, and the data type is INT64. [object Object] indicates the padding size in the H direction, and [object Object] indicates the padding size in the W direction.
    • [object Object] (aclIntArray*, computation input): aclIntArray on the NPU host, convolution stride. The size is 2. The data type is INT64.
    • [object Object] (aclTensor*, computation output): aclTensor on the device. The shape is 2-dimensional (for 3-dimensional input) or 3-dimensional (for 4-dimensional input). The data type can be FLOAT, FLOAT16, or BFLOAT16. are supported. The shape is deduced based on the preceding parameters. The supports ND.
    • [object Object] (uint64_t*, output): size of the workspace to be allocated on the device.
    • [object Object] (aclOpExecutor**, output): operator executor, containing the operator computation process.
  • Returns:

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

[object Object]
[object Object]
  • Parameters:

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

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

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

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

[object Object]