Hello fbrah!



 fbrah:

Just to clarify the confusion let me change the start and end to 41 and 7 respectively.
I want to change x = torch.tensor([1,3,4,41,10,7,5,1,8,3,41,90,78,7,41]) to
torch.tensor([1,3,4,-1,-1,-1,5,1,8,3,-1,-1,-1,-1,41]).


I understand what you are asking now.
I do not see a way to do it using straightforward tensor operations;
I think you will have to loop over the elements in each row.
Best.
K. Frank