How to set the beta?
kojingying opened this issue · 3 comments
Hi @kojingying,
Your beta
definition seems correct. You may want to ensure that the pooled x
tensor will indeed be of oH,oW
size.
For example, you can test if AdaPool2d
works with beta=(1,1)
(broadcasting the same value over the entire tensor as in issue #5 ).
Afterwards, if you would prefer to use beta
as a matrix, you can find any difference between oH,oW
and x.shape[2:]
.
self.pool = nn.AvgPool2d(ih // 32, 1)<——self.pool = AdaPool2d(kernel_size=ih // 32, stride=1, beta=(1, 1))
When I try to replace avgpool2d with adapool2d, the following error occurs:
“AssertionError: Only CUDA implementation supported!”
How can I use it correctly?
@Culturenotes it seems that either your input tensor or the beta is in the CPU. The current implementation only runs in CUDA, so you'll need to have all tensors used in AdaPool2d
in CUDA.