It seems you just want to multiply a tensor of shape [C, H, W] with a tensor of shape [1, H, W].
If so, you can just use this simple code:
x = torch.ones(3, 5, 5)
weight = torch.ones(1, 5, 5) * 2
x * weight