Why does nn.Conv2d require in_channels?

Thanks for your reply
Can we not define the filter size at runtime? Is that against standard pytorch practice?