Hi, thank you for the answer.
The result of the first convolution has the desired shape, but the last one (along x-axis) change the dimension of the columns.
Any ideas?
These are my new padding dimensions:
pad_w, pad_h = int(np.floor(gx.size()[0] / 2)), int(np.floor(gx.size()[0] / 2))