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
481fb996
Commit
481fb996
authored
May 08, 2020
by
Mario Geiger
Browse files
fix
parent
64a8e2ce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
torch_sparse/view.py
torch_sparse/view.py
+3
-2
No files found.
torch_sparse/view.py
View file @
481fb996
...
@@ -8,9 +8,10 @@ def _view(src: SparseTensor, n: int, layout: str = 'csr') -> SparseTensor:
...
@@ -8,9 +8,10 @@ def _view(src: SparseTensor, n: int, layout: str = 'csr') -> SparseTensor:
row
,
col
,
value
=
src
.
coo
()
row
,
col
,
value
=
src
.
coo
()
sparse_sizes
=
src
.
storage
.
sparse_sizes
()
sparse_sizes
=
src
.
storage
.
sparse_sizes
()
if
sparse_sizes
[
0
]
*
sparse_sizes
[
1
]
%
n
=
=
0
:
if
sparse_sizes
[
0
]
*
sparse_sizes
[
1
]
%
n
!
=
0
:
raise
RuntimeError
(
raise
RuntimeError
(
f
"shape '[-1,
{
n
}
]' is invalid for input of size
{
sparse_sizes
[
0
]
*
sparse_sizes
[
1
]
}
"
)
f
"shape '[-1,
{
n
}
]' is invalid for input of size "
f
"
{
sparse_sizes
[
0
]
*
sparse_sizes
[
1
]
}
"
)
assert
layout
==
'csr'
or
layout
==
'csc'
assert
layout
==
'csr'
or
layout
==
'csc'
...
...
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