官方文档对方法进行以下描述:
"Converts a dense adjacency matrix to a sparse adjacency matrix defined
by edge indices and edge attributes."
assert tensor.dim() == 2
index = tensor.nonzero().t().contiguous()
value = tensor[index[0], index[1]]
return index, value
我想知道将稠密邻接矩阵转换为稀疏邻接矩阵的意义是什么?