I am wondering what is the most efficient way of converting a list of indices into a matrix. For example, I want to convert
ind : [[1,3],[1,2,3]]
to the form of
torch.tensor([[0,1,0,1],[0,1,1,1]])
Thanks