xxxxxxxxxx
out = nn.AdaptiveAvgPool2d((2,2))(inp)
print(out)
xxxxxxxxxx
inp = torch.tensor([[[[1,2.,3], [4,5,6], [7,8,9]]]], dtype = torch.float)
print(inp .shape)
print(inp)
xxxxxxxxxx
torch.Size([1, 1, 3, 3])
tensor([[[[1., 2., 3.],
[4., 5., 6.],
[7., 8., 9.]]]])