A combination of gather and scatter_ should work:
x = torch.tensor([[1,2,3],
                  [4,5,6],
                  [7,8,9]])

y = torch.tensor([[11,21,31],
                  [41,51,61],
                  [71,81,91]])

z = torch.tensor([[1],
                  [2],
                  [0]])


k = x.scatter_(1, z, y.gather(1, z))
print(k)
> tensor([[ 1, 21,  3],
          [ 4,  5, 61],
          [71,  8,  9]])