A sparse tensor in pytorch is represented as a pair of dense tensors: a tensor of values and a 2D tensor of indices. sparse tensor don’t have strides,  the directed indexing operation such as x[1] is not allow. torch.sparse module is  currently experimental,  maybe using dense tensor  is preferred
torch.randn(2, 3).to_sparse()
"""
tensor(indices=tensor([[0, 0, 0, 1, 1, 1],
                       [0, 1, 2, 0, 1, 2]]),
       values=tensor([ 0.5527, -0.7956,  0.7942,  0.6294,  0.9592,  0.3199]),
       size=(2, 3), nnz=6, layout=torch.sparse_coo)
"""