lenskit.math.sparse#

Sparse matrix utility functions.

Functions#

torch_sparse_from_scipy(M[, layout])

Convert a SciPy sps.coo_array into a torch sparse tensor.

Module Contents#

lenskit.math.sparse.torch_sparse_from_scipy(M, layout='coo')#

Convert a SciPy sps.coo_array into a torch sparse tensor.

Stability:
Internal (see Stability Levels).
Parameters:
Return type:

torch.Tensor

Exported Aliases#

lenskit.math.sparse.safe_tensor()#

Re-exported alias for lenskit.torch.safe_tensor().