I think this is what you want 

  
    
    
    How to pad one side in pytorch 
  
  
    By default pytorch only support padding on both side, but for example, I have a feature of 1x512x37x56(NCHW) and I want to pad on one side to 1x512x38x57, how can I do it?