pytaco.to_sp_csc

pytaco.to_sp_csc(t)

Converts a taco tensor to a scipy csc_matrix.

Takes a matrix from taco in any format and converts the matrix to a scipy sparse csc matrix. This method removes explicit zeros from the original taco tensor during the conversion.

Parameters
t: tensor

A taco tensor to convert to a scipy.csc_matrix array. The tensor must be of order 2 (i.e it must be a matrix). If the order of the tensor is not equal to 2, a value error is thrown.

Returns
matrix: scipy.sparse.csc_matrix

A matrix containing a copy of the data from the original order 2 tensor t.

Notes

The data and index values are always copied when making the scipy sparse array