Unverified Commit eabdc584 authored by Matthias Fey's avatar Matthias Fey Committed by GitHub
Browse files

Merge pull request #126 from Adam1679/master

check the row/col tensors when initializing the SparseStorage
parents ebeb4509 1a5c6c84
...@@ -59,6 +59,9 @@ class SparseStorage(object): ...@@ -59,6 +59,9 @@ class SparseStorage(object):
sparse_sizes = (int(M), int(N)) sparse_sizes = (int(M), int(N))
else: else:
assert len(sparse_sizes) == 2 assert len(sparse_sizes) == 2
if row is not None:
assert row.max().item() < sparse_sizes[0]
assert col.max().item() < sparse_sizes[1]
if row is not None: if row is not None:
assert row.dtype == torch.long assert row.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