max_pool函数经常用到,所以做个记录
参考官方文档
format:max_pool(value, ksize, strides, padding, data_format='NHWC', name=None)
Args:
value: A 4-D `Tensor` with shape `[batch, height, width, channels]` and type `tf.float32`.(注意这里数据类型必须是tf.float32,不然会出错)
ksize: A list of ints that has length >= 4. The size of the window for each dimension of the input tensor.(一般都是4个元素的list)
strides: A list of ints that has length >= 4. The stride of the sliding
window for each dimension of the input tensor.
padding: A string, either `'VALID'` or `'SAME'`. The padding algorithm.
See the @{tf.nn.convolution$comment here}
data_format: A string. 'NHWC' and 'NCHW' are supported.
name: Optional name for the operation.