I spent a little time trying to find something similar to a “Join on value”, but couldn’t come up with anything…
This is the best I could come up with:
import torch

ts3=torch.tensor([
 [ 24 , 24 , 8 ,0 ],
 [ 38 , 100 , 93 ,0],
 [ 65 , 91 , 73 ,0],
 [ 49 , 26 , 45 ,0],
 [ 78 , 54 , 11 ,0],
 [ 24 , 98 , 12 ,0],
 [ 27 , 55 , 50 ,0],
 [ 11 , 65 , 96 ,0],
 [ 45 , 40 , 16 ,0],
 [ 99 , 54 , 27 ,0]],dtype=torch.int32)

ts2=torch.tensor([[100,10],[26,20],[54,30]],dtype=torch.int32)


for x, y in ts2[:]:
    ts3[:, 3] = torch.where(ts3[:, 1] == x, y, ts3[:, 3])

I know you didn’t want a loop, but this may help cut down on the amount of looping you were originally thinking there would be.
I’m still pretty new to Pytorch, so there is likely still a better way.