When using Conv2D in PyTorch, does padding or dilation happen first?
Consider the following bit of code:

torch.nn.Conv2d(1, 1, 2, padding = 1, dilation = 2)

Which of the following two cases is a correct interpretation?



If you look at the bottom of the nn.Conv2d documentation you'll see the formula used to compute the output size of the conv layer:



Notice how padding is not affected by the value of dilation. I suppose this indicates "pad first" approach.
