Interesting. If I set torch.manual_seed(1) it doesn’t have an effect. If I leave it out it does something, but not what I would expect:
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(reduction='none', pos_weight=weight)
criterion = nn.BCEWithLogitsLoss(reduction='none')

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

print(loss)
> tensor([[[[0.9330, 0.8368],
          [1.2952, 0.6551]],
         [[0.3611, 0.3950],
          [1.0079, 0.7523]],
         [[0.6751, 0.3964],
          [0.9588, 0.7661]]]])
print(weighted_loss)
> tensor([[[[0.9330, 0.8368],
          [1.2952, 0.6551]],
         [[0.3611, 0.3950],
          [1.0079, 0.7523]],
         [[675.08, 396.43],
          [0.95880, 0.76611]]]])

It only changed the upper two pixels of the last channel.