Hi,
I do not know the input size, but if 0.5 padding size is the answer, it is impossible, as we do not have half-pixel. That is one of the reasons that odd size kernels are preferred. Also, odd size kernels have a single pixel as the origin cell, which enables better weighting.
But if you like one sided padding, you can do this by explicitly padding your input then applying conv2d. For padding you can use torch.nn.functiona.pad function. See this post for more information:

  
    
    
    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?
  


The reason I suggested one side padding is that, PyTorch by default uses two sided paddings so I think that is why you ended up with padding size of 0.5. S, other choice could be padding only one side.
Bests