提交 6e54a3bf 编写于 作者: M Megvii Engine Team

docs(mge): update MaxPool2d & functional.nn.max_pool2d docstring

GitOrigin-RevId: b46f227b59ef98d16e1c08a2ae3526467a79cd60
上级 923dc2d5
......@@ -658,16 +658,16 @@ def max_pool2d(
Refer to :class:`~.MaxPool2d` for more information.
Args:
inp: input tensor of shape :math:`(N, C, H_{in}, W_{in})`.
inp: input tensor of shape :math:`(N, C, H_{\text{in}}, W_{\text{in}})`.
kernel_size: size of the window used to calculate the max value.
stride: stride of the window. If not provided, its value is set to kernel_size.
Default: ``None``
padding: implicit zero padding added on both sides. Default: :math:`0`
stride: stride of the window. Default value is ``kernel_size``.
padding: implicit zero padding added on both sides. Default: 0.
Returns:
output tensor of shape `(N, C, H_{out}, W_{out})`.
output tensor of shape `(N, C, H_{\text{out}}, W_{\text{out}})`.
Examples:
>>> import numpy as np
>>> input = tensor(np.arange(1 * 1 * 3 * 4).astype(np.float32).reshape(1, 1, 3, 4))
>>> F.nn.max_pool2d(input, 2, 1, 0)
Tensor([[[[ 5. 6. 7.]
......
......@@ -32,9 +32,9 @@ class _PoolNd(Module):
class MaxPool2d(_PoolNd):
r"""Applies a 2D max pooling over an input.
For instance, given an input of the size :math:`(N, C, H, W)` and
For instance, given an input of the size :`(N, C, H_{\text{in}}, W_{\text{in}})` and
:attr:`kernel_size` :math:`(kH, kW)`, this layer generates the output of
the size :math:`(N, C, H_{out}, W_{out})` through a process described as:
the size :math:`(N, C, H_{\text{out}}, W_{\text{out}})` through a process described as:
.. math::
......@@ -48,9 +48,9 @@ class MaxPool2d(_PoolNd):
both sides for :attr:`padding` number of points.
Args:
kernel_size: the size of the window to take a max over.
stride: the stride of the window. Default value is kernel_size.
padding: implicit zero padding to be added on both sides.
kernel_size: the size of the window.
stride: the stride of the window. Default value is ``kernel_size``.
padding: implicit zero padding to be added on both sides.Default: 0.
Examples:
>>> import numpy as np
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册