FilesLast commitLast update
5 days ago
2 months ago
1 month ago
2 months ago
1 month ago
9 days ago
9 days ago
25 days ago
2 months ago
9 days ago
5 days ago
5 days ago
README

AvgPool3DGrad

English | 简体中文

Applicable Products

Product Support
Ascend 950PR&950DT products √
Atlas A3 products √
Atlas A2 products √
Atlas 200I/500 A2 inference products ×
Atlas inference products ×
Atlas training products ×

Function

  • Operator function: Backpropagation of 3D average pooling, which computes the input gradient of the forward propagation of 3D average pooling.

  • Formula:

Dout=⌊Din+2×pads[0]−ksize[0]strides[0]+1⌋D_{out} = \left\lfloor \frac{D_{in} + 2 \times \text{pads}[0] - \text{ksize}[0]}{\text{strides}[0]} + 1 \right\rfloor

Hout=⌊Hin+2×pads[1]−ksize[1]strides[1]+1⌋H_{out} = \left\lfloor \frac{H_{in} + 2 \times \text{pads}[1] - \text{ksize}[1]}{\text{strides}[1]} + 1 \right\rfloor

Wout=⌊Win+2×pads[2]−ksize[2]strides[2]+1⌋W_{out} = \left\lfloor \frac{W_{in} + 2 \times \text{pads}[2] - \text{ksize}[2]}{\text{strides}[2]} + 1 \right\rfloor

If the attribute ceil_mode is True and the condition (Dout−1)×stride[0]≥Din+padding[0](D_{out} - 1) \times \text{stride}[0] \geq D_{in} + \text{padding}[0] is satisfied, the last window is skipped, which reduces the dimension DoutD_{out} by 1. This rule also applies to the dimensions WoutW_{out} and HoutH_{out}.

Parameters

Parameter name Input/Output/Attribute Description Data type Data format
orig_input_shape Input
  • Value of the input shape of the forward propagation.
  • The input value is [N,C,Din,Hin,Win].
INT32 ND
grads Input
  • Gradient of the backward input.
  • The input shape is [N,C,Dout,Hout,Wout] or [N,Dout,Hout,Wout,C].
FLOAT, FLOAT16, BFLOAT16 ND
ksize Attribute Size of the pooling window. The value must be greater than 0. INT64 -
strides Attribute Stride of the pooling operation. The value must be greater than 0. INT64 -
pads Attribute Number of layers padded with 0 along the D, H, and W directions of the input. The value must be greater than or equal to 0. INT64 -
ceil_mode Optional attribute
  • Specifies whether the shape of the output inferred during forward average pooling is rounded up (True means rounding up).
  • Default value: false.
BOOL -
count_include_pad Optional attribute
  • Specifies whether to include the 0 values padded by pads when computing forward average pooling (True means including the padded 0 values).
  • Default value: true.
BOOL -
divisor_override Optional attribute
  • Divisor used for averaging. If it is specified, it is used as the divisor in the average computation. When the value is 0, this attribute does not take effect.
  • Default value: 0.
INT -
data_format Optional attribute
  • Specifies the data format of the input `grads`.
  • The value must be one of ["NDHWC","NCDHW"]. Default value: "NDHWC".
STRING -
output Output Output parameter of the AvgPool3DGrad computation. Its shape must be consistent with the value of `orig_input_shape`. FLOAT, FLOAT16, BFLOAT16 ND

Constraints

  • divisor_override uses the INT type as the attribute input but is computed in FLOAT32 internally. If the absolute value of divisor_override is greater than 2^24 (16777216), it cannot be represented exactly and precision loss may occur.

Invocation Description

Invocation method Sample code Description
aclnn invocation test_aclnn_avgpool3d_backward.cpp Invokes the AvgPool3DGrad operator through the aclnnAvgPool3dBackward interface.