[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Performs three-dimensional average pooling on the input tensor with the window of kDkHkWkD * kH * kW and stride of sDsHsWsD * sH * sW. Specifically, kk is kernelSize, indicating the size of the pooling window. ss is stride, indicating the pooling stride.
  • Formula: The relationship among the input(N,C,Din,Hin,WinN,C,D_{in},H_{in},W_{in}), out(N,C,Dout,Hout,WoutN,C,D_{out},H_{out},W_{out}), pooling stride (stridestride), and kernelSize (kD,kH,kWkD,kH,kW) is as follows:
Dout=Din+2padding[0]kernelSize[0]stride[0]+1D_{out}=\lfloor \frac{D_{in}+2*padding[0]-kernelSize[0]}{stride[0]}+1 \rfloor Hout=Hin+2padding[1]kernelSize[1]stride[1]+1H_{out}=\lfloor \frac{H_{in}+2*padding[1]-kernelSize[1]}{stride[1]}+1 \rfloor Wout=Win+2padding[2]kernelSize[2]stride[2]+1W_{out}=\lfloor \frac{W_{in}+2*padding[2]-kernelSize[2]}{stride[2]}+1 \rfloor out(Ni,Ci,d,h,w)=1kDkHkWk=0kD1m=0kH1n=0kW1input(Ni,Ci,stride[0]d+k,stride[1]h+m,stride[2]w+n)out(N_i,C_i,d,h,w)=\frac{1}{kD*kH*kW}\sum_{k=0}^{kD-1}\sum_{m=0}^{kH-1}\sum_{n=0}^{kW-1}input(N_i,C_i,stride[0]*d+k,stride[1]*h+m,stride[2]*w+n) [object Object]

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

  • [object Object]

  • [object Object]

[object Object]
  • Parameters:

    • self (aclTensor*, compute input): tensor to be converted (inputinput in the formula), which is a tensor on the device. Empty tensors are supported. The can be ND (corresponding to CDHW) or 5D-format NCDHW. are supported.
      • [object Object]Atlas inference series products[object Object]: The data type can be FLOAT16 or FLOAT32.
      • [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]: The data type can be BFLOAT16, FLOAT16, or FLOAT32.
    • kernelSize (aclIntArray*, compute input): pooling window size (kernelSizekernelSize in the formula), which is an aclIntArray on the host. The length is 1 (kD=kH=kWkD=kH=kW) or 3 (kD,kH,kWkD, kH, kW). The data type is INT64. The value must be greater than 0 and less than or equal to the value of the corresponding dimension of the input.
    • stride (aclIntArray*, compute input): pooling stride (stridestride in the formula), which is an aclIntArray on the host. The length is 0 (value:kernelSizevalue: kernelSize), 1 (sD=sH=sWsD=sH=sW), or 3 (sD,sH,sWsD, sH, sW). The data type is INT64. The value must be greater than 0.
    • padding (aclIntArray*, compute input): number of zero-padding layers in the D, H, and W directions of the input (paddingpadding in the formula), which is an aclIntArray on the host. The length is 1 (padD=padH=padWpadD=padH=padW) or 3 (padD,padH,padWpadD, padH, padW). The data type is INT64. The value is within the range of [0, kernelSize/2].
    • ceilMode (bool, compute input): The data type can be BOOL. False indicates rounding down when computing the output shape. Otherwise, rounding up.
    • countIncludePad (bool, compute input): The data type can be BOOL. True indicates that zero padding is included in the average computation. Otherwise, zero padding is not included.
    • divisorOverride (int64_t, compute input): The data type can be INT64. If specified, it is used as a divisor in the average computation. When the value is 0, this attribute does not take effect.
    • out (aclTensor*, compute output): output tensor, which is outout in the formula. The can be ND (corresponding to (C,Dout,Hout,WoutC,D_{out},H_{out},W_{out})) or 5D (N,C,Dout,Hout,WoutN,C,D_{out},H_{out},W_{out}). are supported. The data type and must be the same as those of self.
      • [object Object]Atlas inference series products[object Object]: The data type can be FLOAT16 or FLOAT32.
      • [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]: The data type can be BFLOAT16, FLOAT16, or FLOAT32.
    • 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 aclnnAvgPool3dGetWorkspaceSize.
    • 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]
  • Deterministic compute:
    • aclnnAvgPool3d defaults to a deterministic implementation.
[object Object]

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

[object Object]