Hi again, I’m still a bit lost. I analysed your code that you gave me, but still that doesn’t answer a different question - why dephwise convs use the the same set of weights for all channels.
conv_1 = nn.Conv2d(3, 9, 3, 1, 1, bias=False, groups=1)
conv_2 = nn.Conv2d(3, 9, 3, 1, 1, bias=False, groups=3)
print(f'normal conv2d weights shape: {conv_1.weight.shape}')
print(f'depthwise separable conv weights shape: {conv_2.weight.shape}')

Answer:
normal conv2d weights shape: torch.Size([9, 3, 3, 3])
depthwise separable conv weights shape: torch.Size([9, 1, 3, 3])

This code clearly shows that depthwise separable convs use only one kernel for all input channels. Why can’t depthwise separable convs use different kernel for every input channel?
Excuse me if I’m being too noisy, but I really want to get the whole idea behind depthwise convs.