Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torch-sparse
Commits
eabdc584
Unverified
Commit
eabdc584
authored
Apr 01, 2021
by
Matthias Fey
Committed by
GitHub
Apr 01, 2021
Browse files
Merge pull request #126 from Adam1679/master
check the row/col tensors when initializing the SparseStorage
parents
ebeb4509
1a5c6c84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
torch_sparse/storage.py
torch_sparse/storage.py
+3
-0
No files found.
torch_sparse/storage.py
View file @
eabdc584
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment