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
0e18448b
Commit
0e18448b
authored
Mar 31, 2021
by
adam
Browse files
check the row/col tensors when initializing the SparseStorage
parent
ebeb4509
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
torch_sparse/storage.py
torch_sparse/storage.py
+2
-0
No files found.
torch_sparse/storage.py
View file @
0e18448b
...
@@ -59,6 +59,7 @@ class SparseStorage(object):
...
@@ -59,6 +59,7 @@ 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
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
...
@@ -66,6 +67,7 @@ class SparseStorage(object):
...
@@ -66,6 +67,7 @@ class SparseStorage(object):
assert
row
.
dim
()
==
1
assert
row
.
dim
()
==
1
assert
row
.
numel
()
==
col
.
numel
()
assert
row
.
numel
()
==
col
.
numel
()
row
=
row
.
contiguous
()
row
=
row
.
contiguous
()
assert
row
.
max
().
item
()
<
sparse_sizes
[
0
]
if
rowptr
is
not
None
:
if
rowptr
is
not
None
:
assert
rowptr
.
dtype
==
torch
.
long
assert
rowptr
.
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