I assume you mean the in_channel dimension of a conv layer by “channel dim”?
If so, this would work:
conv = nn.Conv2d(3, 6, 3, 1, 1)
conv.weight.sum([0, 2, 3])
> tensor([-0.2552,  0.2478,  0.3706], grad_fn=<SumBackward1>)