I don’t think it could be an answer. The point is I want to extract them, with different sizes. So the tensor of the first example will be [1, 2, 3, 4, 5, 6] and the second one will be [11, 12, 13, 14]. I guess that torch.gather only results tensors have the same size.