[][src]Function autograd::ops::max_pool2d

pub fn max_pool2d<T: Float, A: AsRef<Tensor<T>>>(
    x: A,
    pool_size: usize,
    pad: usize,
    stride: usize
) -> Tensor<T>

2D max pooling.

  • x: Tensor with shape (batch, channel, h, w)

Returns a tensor with shape (batch, channel, out_h, out_w)

where

  • out_h = (h + 2 * pad - pool_size) / stride + 1
  • out_w = (w + 2 * pad - pool_size) / stride + 1