Well, i would not use loops in tensors.
Seems like torch.gather is thing i need.
But not sure how to generate tensor with all indeces i need.
Like if mask start at 10 and ends at 74, i should have tensor with 10,11,12… 73, 73.