liam.schoneveld:

Shouldn’t there be two weights, each of size [8, 8, 1, 1] ?


There are two groups of this size concatenated in dim0.
Have a look at this small example:
conv_grouped = nn.Conv2d(16, 16, 1, groups=2, bias=False)
output_grouped = conv_grouped(x)
output_grouped.shape

conv1 = nn.Conv2d(8, 8, 1, bias=False)
conv2 = nn.Conv2d(8, 8, 1, bias=False)
with torch.no_grad():
    conv1.weight.copy_(conv_grouped.weight[:8])
    conv2.weight.copy_(conv_grouped.weight[8:])

output1 = conv1(x[:, :8])
output2 = conv2(x[:, 8:])
output_manual = torch.cat((output1, output2), dim=1)

print((output_manual == output_grouped).all())
> tensor(1, dtype=torch.uint8)

As you can see, the first half of the conv_grouped weights will be applied to the first half of the channels in x and the second half of the weights to the second half of the channels.