评价此页

avg_pool2d#

class torch.ao.nn.quantized.functional.avg_pool2d(input, kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True, divisor_override=None)[source]#

kH×kWkH \times kW 区域上应用 2D 平均池化操作,步长为 sH×sWsH \times sW 。输出特征的数量等于输入平面的数量。

注意

输入量化参数会传播到输出。

有关详细信息和输出形状,请参阅 AvgPool2d

参数
  • input – 量化输入张量 (minibatch,in_channels,iH,iW)(\text{minibatch} , \text{in\_channels} , iH , iW)

  • kernel_size – 池化区域的大小。可以是单个数字或元组 (kH, kW)

  • stride – 池化操作的步长。可以是单个数字或元组 (sH, sW)。默认为 kernel_size

  • padding – 输入两侧的隐式零填充。可以是单个数字或元组 (padH, padW)。默认为 0

  • ceil_mode – when True, will use ceil instead of floor in the formula to compute the output shape. Default: False

  • count_include_pad – when True, will include the zero-padding in the averaging calculation. Default: True

  • divisor_override – 如果指定,将用作除数,否则将使用池化区域的大小。默认为 None