入门
进阶内容
API 参考
SparseMatrix
注意事项
其他
如果稀疏矩阵包含重复索引,则返回 True。
True
示例
>>> indices = torch.tensor([[1, 0, 0, 0, 1], [1, 1, 1, 2, 2]]) >>> val = torch.tensor([0, 1, 2, 3, 4]) >>> A = dglsp.spmatrix(indices, val) >>> A.has_duplicate() True >>> A.coalesce().has_duplicate() False