def sparse_to_tuple(sparse_mx):
"""Convert sparse matrix to tuple representation. Convert sparse matrix to tuple representation"""
def to_tuple(mx):
if not sp.isspmatrix_coo(mx):
mx = mx
python局部函数以及稀疏矩阵转化为元组后的效果
最新推荐文章于 2022-07-24 16:58:45 发布