Hi, I have four tensors with size of 64*256. Can I use average pooling to do average on these 4 tensors and the output after the pooling operation should be something like k * 256 ?
Looking forward to hearing from you!
I’m unsure how exactly your input tensor would look like, but assuming it has the shape [batch_size=4, channels, 64, 256]
, this might work:
k = 32
pool = nn.AdaptiveAvgPool2d((k, 256))
x = torch.randn(4, 16, 64, 256)
out = pool(x)
print(out.shape)
# torch.Size([4, 16, 32, 256])
Hi,thanks. This works for me.