Pytorch: In Con2d layer,how to pad "Same" not "Zero"

Created on 17 Mar 2017  ·  3Comments  ·  Source: pytorch/pytorch

In Con2d layer,how to pad "Same" not "Zero".

In tensorflow , i see the option to choose whether pad the "Same" pixel as edge or pad "Zero" pixel .But dose pytorch have that option?

Most helpful comment

pytorch does not have this option. if you want to do something like this, you have to explicitly pad via nn.functional.pad in the replicate mode: http://pytorch.org/docs/nn.html#torch.nn.functional.pad

All 3 comments

pytorch does not have this option. if you want to do something like this, you have to explicitly pad via nn.functional.pad in the replicate mode: http://pytorch.org/docs/nn.html#torch.nn.functional.pad

thanks

Why does pytorch not have this feature? It would greatly help with quick prototyping

Was this page helpful?
0 / 5 - 0 ratings