Here is a more complete fragment
def _conv_pad_size(k, d=1):
    return (k - 1) // 2 + k // 2 * (d - 1)

class ConvBlock(nn.Sequential):
    def __init__(self, in_, out, kernel_size=3, dilation=1, pool=1):
        padding = _conv_pad_size(kernel_size, dilation)
        super().__init__(
            nn.Conv2d(in_, out, kernel_size, padding=padding, dilation=dilation),
            nn.BatchNorm2d(out),
            nn.MaxPool2d(pool),
            nn.ReLU(inplace=True)
        )

I use a series of blocks with increasing number of channels. All blocks have dilation=2, kernel_size=3