In your case, you will need the following code:
i = torch.LongTensor([[0, 1, 2], [0, 1, 2]])
v = torch.FloatTensor([1,1,1])
t = torch.sparse.FloatTensor(i, v, torch.Size([3,3]))
a = t.to_dense()     #this is necessary
a.lu()