I think you want scatter_:
x = torch.tensor([[0, 1, 2, 3, 4],
                  [ 5, 6, 7, 8, 9],
                  [10, 11, 12, 13, 14]], dtype=torch.float)
index = torch.tensor([[1, 3], [0, 4], [2, 3]])
x.scatter_(1, index, 42)
print (x == torch.tensor([[0, 42, 2, 42, 4],
                  [42, 6, 7, 8, 42],
                  [10, 11, 42, 42, 14]], dtype=torch.float))

For more complex tasks, you could also build an index for the first dimension and use indexing:
x = torch.tensor([[0, 1, 2, 3, 4],
                  [ 5, 6, 7, 8, 9],
                  [10, 11, 12, 13, 14]], dtype=torch.float)
index = torch.tensor([[1, 3], [0, 4], [2, 3]])
index0 = torch.arange(3, dtype=torch.long)[:, None].expand(-1, 2)
x[index2.reshape(-1), index.view(-1)] = 42
print (x == torch.tensor([[0, 42, 2, 42, 4],
                  [42, 6, 7, 8, 42],
                  [10, 11, 42, 42, 14]], dtype=torch.float))

Best regards
Thomas