It seems to work for me:
input = torch.rand(1, 3, 2, 2)
target = torch.round(torch.rand(1, 3, 2, 2))

weight = torch.tensor([1., 1., 1000.]).view(1, 3, 1, 1).expand(-1, -1, 2, 2)

weighted_criterion = nn.BCEWithLogitsLoss(pos_weight=weight)
criterion = nn.BCEWithLogitsLoss()

weighted_loss = weighted_criterion(input, target)
loss = criterion(input, target)

print(weighted_loss)
> tensor(75.8810)
print(loss)
> tensor(0.7734)