Solved by ptrblck in post #3 
              
              
                This code should work: 
x = torch.tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1],
                  [1, 1, 1, 1, 1, 1, 1, 1, 1],
                  [1, 1, 1, 1, 1, 1, 1, 1, 1]])

C = torch.tensor([[1], [0], [1]]).squeeze(1).nonzero().squeeze(1)
B = torch.tensor([[1], [7]]).squeeze(1)
x[C, B] = 0
print(x)

Note …