Commit 0e18448b authored by adam's avatar adam
Browse files

check the row/col tensors when initializing the SparseStorage

parent ebeb4509
......@@ -59,6 +59,7 @@ class SparseStorage(object):
sparse_sizes = (int(M), int(N))
else:
assert len(sparse_sizes) == 2
assert col.max().item() < sparse_sizes[1]
if row is not None:
assert row.dtype == torch.long
......@@ -66,6 +67,7 @@ class SparseStorage(object):
assert row.dim() == 1
assert row.numel() == col.numel()
row = row.contiguous()
assert row.max().item() < sparse_sizes[0]
if rowptr is not None:
assert rowptr.dtype == torch.long
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment