PyTorch_MaxPool2d

2D最大池化

PyTorch_MaxPool2d_第1张图片

代码

import torch
import torch.nn as nn

input = torch.randn(1, 3, 224, 224)
maxpooling2d = nn.MaxPool2d(3, 2)
output = maxpooling2d(input)
print(output.size())

torch.Size([1, 3, 111, 111])
import torch
import torch.nn as nn

input = torch.randn(1, 3, 224, 224)
maxpooling2d = nn.MaxPool2d(3, 2, 1)
output = maxpooling2d(input)
print(output.size())

torch.Size([1, 3, 112, 112])

引用

<1>

torch=1.7.1+cu101
torchvision=0.8.2
torchaudio=0.7.2

你可能感兴趣的:(pytorch)