Hi,
The usual trick here is that if your stride is 1 an dilation is 1and your kernel has an odd size, you can set the padding to be floor(kernel_size/2).
If you use a stride that is not 1, you won’t be able to remove l_in from the formula above I’m afraid.