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
139cc6c1
Commit
139cc6c1
authored
Jul 28, 2020
by
rusty1s
Browse files
Merge branch 'master' of github.com:rusty1s/pytorch_sparse
parents
d3a94a25
18bd8b67
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
torch_sparse/__init__.py
torch_sparse/__init__.py
+1
-1
torch_sparse/reduce.py
torch_sparse/reduce.py
+1
-1
torch_sparse/tensor.py
torch_sparse/tensor.py
+1
-1
No files found.
torch_sparse/__init__.py
View file @
139cc6c1
...
...
@@ -12,7 +12,7 @@ for library in [
torch
.
ops
.
load_library
(
importlib
.
machinery
.
PathFinder
().
find_spec
(
library
,
[
osp
.
dirname
(
__file__
)]).
origin
)
if
torch
.
version
.
cuda
is
not
None
:
# pragma: no cover
if
torch
.
cuda
.
is_available
()
and
torch
.
version
.
cuda
:
# pragma: no cover
cuda_version
=
torch
.
ops
.
torch_sparse
.
cuda_version
()
if
cuda_version
==
-
1
:
...
...
torch_sparse/reduce.py
View file @
139cc6c1
...
...
@@ -35,7 +35,7 @@ def reduction(src: SparseTensor, dim: Optional[int] = None,
if
dim
==
0
and
value
is
not
None
:
col
=
src
.
storage
.
col
()
return
scatter
(
value
,
col
,
dim
=
0
,
dim_size
=
src
.
size
(
0
)
)
return
scatter
(
value
,
col
,
0
,
None
,
src
.
size
(
1
),
reduce
)
elif
dim
==
0
and
value
is
None
:
if
reduce
==
'sum'
or
reduce
==
'add'
:
return
src
.
storage
.
colcount
().
to
(
src
.
dtype
())
...
...
torch_sparse/tensor.py
View file @
139cc6c1
...
...
@@ -66,7 +66,7 @@ class SparseTensor(object):
value
:
Optional
[
torch
.
Tensor
]
=
None
if
has_value
:
value
=
mat
.
_
values
()
value
=
mat
.
values
()
return
SparseTensor
(
row
=
row
,
rowptr
=
None
,
col
=
col
,
value
=
value
,
sparse_sizes
=
(
mat
.
size
(
0
),
mat
.
size
(
1
)),
...
...
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