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局部函数以及稀疏矩阵转化为元组后的效果
最新推荐文章于 2023-10-09 10:53:44 发布