Hello!
Let’s say I have a length’s tensor (lengths_tensor) : len of shape [32 X count] for example :
tensor([1, 1, 1, 1, 3, 1, 1, 2, 1, 2, 3, 1, 2, 2, 2, 3, 4, 1, 3, 1, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 1], device=‘cuda:0’)
and another features tensor of shape [32 X Dimension]
what I want to do is for each entry (i) in the features tensor to repeat it lengths_tensor[i] times, so given the example above the first element in the feature tensor should not be repeated, and for the element in place 4 shall be repeated 3 times, so the new feature tensor should be of shape [60 x Dimension]
Thanks!