floor + 1 is different to ceil for the case of a zero, which is needed in the calculation:
floor(0) + 1 = 1, while ceil(0) = 0


We subtract 1 in the numerator. Have a look at the Conv arithmetic 2 to derive the formula. Basically if you reformulate the dilated conv output shape formula, you’ll get to the one used in the PyTorch docs.