torch.cat worked, thank you @ptrblck.
Now I have list of tensors with length 314, and tensors shape is 64x10 except the last one (16x10).
prediction = [*prediction_test, *prediction_testsh]

And the mask with length 10000 and mask[0].shape 20000 :
idxt = [*idx_test, *idx_testsh]
i = torch.cat(idxt)   
mask = [u==i for u in torch.unique(i)]

then multiplication between mask and prediction should give the predictions for equal indices?  how multiplication between these list of tensors can be done? I tried to convert list of tensors to tensor and then torch.mul(a,b) but that gave error for not matching the size between tensor a and tensor b.