Either I do not understand the rationale for the pad input order or there’s a flip.
As I understand the input to pad would be (height_0, height_k, width_0, width_k), H&W ordered just like torch.Tensor. But that’s not what I see.
version:  ‘0.4.1.post2’

zero = torch.zeros(1,1,4,3)
cpad = nn.ConstantPad2d([0,2,0,0], -1)
padded = cpad(zero)
print(padded.size())

I would expect my result to be padded by 2 in the Height dimension, ie. size = (1,1,6,3) but I get
torch.Size([1, 1, 4, 5])
perhaps clearer example

zero = torch.zeros(1,1,4,3)
cpad = nn.ConstantPad2d([2,2,0,0], -1)
padded = cpad(zero)
print(padded.size())

Returns
torch.Size([1, 1, 4, 7])
thank you