Here’s an easy way to do it:
x = torch.FloatTensor([[ 0,  1,  2],
                                    [ 3,  4,  5],
                                    [ 6,  7,  8],
                                    [ 9, 10, 11]])

idx = torch.LongTensor([1, 0, 0, 2])
j = torch.arange(x.size(0)).long()

update_values = torch.FloatTensor([111,222,333,444])

x[j, idx] = update_values

Cheers!