What i wanted to is from a mask update a value of a tensor using a mask.
x = torch.randint(3, 10, (100, 3), dtype=torch.long)
print(x[50]) # prints a random tensor of size (3)
mask = torch.zeros(100).byte() # generate a random mask
mask[50] = 1
print(x[mask], x[mask][0]) # prints tensor of size (1,3), tensor of size (3,)
x[mask][0][0] = 2 # assign a value to
print(x[mask][0][0]) # Doesn’t change change the value in tensor x