alexandrosstergiou / SoftPool

[ICCV 2021] Code for approximated exponential maximum pooling
MIT License
288 stars 52 forks source link

about dim Ceil_Mode =True #24

Closed XinyingZheng closed 3 years ago

XinyingZheng commented 3 years ago

The original pool operation can set the parameter Ceil_Mode =True, then how can the soft pool achieve the same effect, because there is a dimension mismatch problem in my replacement

alexandrosstergiou commented 3 years ago

Hi @XinyingZheng ,

The ceil_mode parameter just adds columns on the left and rows on the bottom side of the tensor to make the tensor fit with the parameters given.

You can simply use torch.nn.functional.pad to immitate that in your def forward(self) function.

Best, Alex

XinyingZheng commented 3 years ago

Hi @XinyingZheng ,

The ceil_mode parameter just adds columns on the left and rows on the bottom side of the tensor to make the tensor fit with the parameters given.

You can simply use torch.nn.functional.pad to immitate that in your def forward(self) function.

Best, Alex

thank you for your reply, i have sloved this problem,best wishes to you!