vision
vision copied to clipboard
[enhancement] Replacement nn.AvgPool2d by nn.AdaptiveAvgPool
Hello,
Thanks for creating the Resnet in pytorch. The network could be made more flexible towards different inputsizes when the avgpool2d layer is replaced by the AdaptiveAvgPool layer.
self.avgpool = nn.AvgPool2d(7, stride=1)
could be replaced by
self.avgpool = nn.AdaptiveAvgPool2d(1)
Hi,
This has been implemented in https://github.com/pytorch/vision/pull/643
Thanks for opening the issue!