参考自tf2.1
官方文档:
https://www.tensorflow.org/api_docs/python/tf/nn/max_pool2d
Performs the max pooling on the input.
用于在输入中进行max pooling操作
tf.nn.max_pool2d(
input, ksize, strides, padding, data_format='NHWC', name=None
)
Args:
- input: A 4-D Tensor of the format specified by data_format.
- input: 由
data_format
指定的4D张量 - ksize: An int or list of ints that has length 1, 2 or 4. The size of the window for each dimension of the input tensor.
- ksize: 一个整数或者长度为1,2或4的整型列表。指定输入张量每个维度的窗口大小。
- strides: An int or list of ints that has length 1, 2 or 4. The stride of the sliding window for each dimension of the input tensor.
- strides: 一个整数或者长度为1,2或4的整型列表。指定输入张量每个维度的移动的步长
- padding: A string, either ‘VALID’ or ‘SAME’. The padding algorithm. See the “returns” section of tf.nn.convolution for details.
- padding: 一个字符串,可以是
'VALID'
或者是SAME
。 - data_format: A string. ‘NHWC’, ‘NCHW’ and ‘NCHW_VECT_C’ are supported.
- data_format: 一个字符串,支持
'NHWC'
,'NCHW'
和'NCHW_VECT_C'
- name: Optional name for the operation.
- name: 操作的名字
Returns:
- A Tensor of format specified by
data_format
. The max pooled output tensor. - 返回经过
max pooling
的张量,该张量的格式被data_format
所指定