SparseMatrix

class odl.core.sparse.sparse_matrix.SparseMatrix(format: str, impl: str, *args, **kwargs)[source]

Bases: object

SparseMatrix is the ODL interface to the sparse Matrix supports in different backends.

Note: The user is responsible for using the *args and **kwargs expected by the respective backends: Pytorch:

Scipy:

-> COO: https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.coo_matrix.

Examples: SparseMatrix(‘COO’, ‘pytorch’,

[[0, 1, 1],[2, 0, 2]], [3, 4, 5], device=’cuda:0’)

SparseMatrix(‘COO’, ‘scipy’,

(3, 4))

__init__()