torch.nn.functional.avg_pool2d#
- torch.nn.functional.avg_pool2d(input, kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True, divisor_override=None) Tensor#
在 區域上應用 2D 平均池化操作,步長為 。輸出特徵的數量等於輸入平面的數量。
有關詳細資訊和輸出形狀,請參閱
AvgPool2d。- 引數
input – 輸入張量
kernel_size – 池化區域的大小。可以是單個數字、單元素元組或元組 (kH, kW)
stride – 池化操作的步長。可以是單個數字、單元素元組或元組 (sH, sW)。預設為
kernel_sizepadding – 輸入兩側的隱式零填充。可以是單個數字、單元素元組或元組 (padH, padW)。應不超過有效核大小的一半,即 。預設為 0
ceil_mode – when True, will use ceil instead of floor in the formula to compute the output shape. Default:
Falsecount_include_pad – when True, will include the zero-padding in the averaging calculation. Default:
Truedivisor_override – 如果指定,將用作除數,否則將使用池化區域的大小。預設為 None