import torch
from torch import nn
import torch.nn.functional as F
input = torch.ones((2,4,2,2))
weight = torch.ones((2,4,2,2))
input[0][1] = input[0][1]*2
input[1][0] = input[1][0]*3
input[1][1] = input[1][1]*4
weight[0][1] = weight[0][1]*2
weight[1][0] = weight[1][0]*3
weight[1][1] = weight[1][1]*4
weight = weight.reshape((4,1,2,2)) 
result = F.conv2d(input, weight, padding=1, stride=1, groups=2)
print(input)
print(weight)
print(result)
print(result.shape)

I just write this to verify that the number multiplied is not what I want.
Because reshape is to make every channel and still reserve the order of filter
But I need reshape it with the same channel depth in the sub-group
Sorry, maybe I cannot explained it clearly.