I want to create one code such that no matter what task or input size the image is, it will always produce a ConvNet such that the padding is set such that the size of the features is always equal to the size of the original image (up until the end/final layer).
How does one do that in pytorch?

I realized this might be useful:

  
    
    
    'Same' convolution in pytorch vision
  
  
    Hi, 
Is there a simple way to do ‘same’ convolution in pytorch such that the output spacial dimensions equals the input counterpart ? 
Best
  



Cross posted with code:

  
      stackoverflow.com
  
  
      
    
  

  Implementing same convolution in Pytorch 114



  python, conv-neural-network, pytorch



  asked by
  
  
    Pinocchio
  
  on 04:03PM - 31 Jul 19 UTC