Apply the 2d pooling.

Set padding to VALID will use the value of pads.

If global_pooling is True, strides and pads will be set to 1 and 0.

  • inputs (dragon.Tensor) – The input tensor.
  • kernel_shape (Sequence[int]) – The shape of pooling kernel.
  • strides (Sequence[int]) – The stride(s) of of pooling,
  • pads (Sequence[int], optional, default=0) – The zero padding size(s) of pooling.
  • padding ({'VALID', 'SAME', 'SAME_UPPER', 'SAME_LOWER'}, optional) – The padding algorithm.
  • ceil_mode (bool, optional, default=False) – Whether to ceil the boundary.
  • mode ({'MAX', 'AVG'}, optional) – The pooling mode.
  • data_format ({'NCHW', 'NHWC'}, optional) – The optional data format.
  • global_pooling (bool, optional, default=False) – Whether to apply the global pooling.

dragon.Tensor – The output tensor.