Skip to content

Commit 139cc6c

Browse files
committed
Merge branch 'master' of github.com:rusty1s/pytorch_sparse
2 parents d3a94a2 + 18bd8b6 commit 139cc6c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

torch_sparse/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
1313
library, [osp.dirname(__file__)]).origin)
1414

15-
if torch.version.cuda is not None: # pragma: no cover
15+
if torch.cuda.is_available() and torch.version.cuda: # pragma: no cover
1616
cuda_version = torch.ops.torch_sparse.cuda_version()
1717

1818
if cuda_version == -1:

torch_sparse/reduce.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def reduction(src: SparseTensor, dim: Optional[int] = None,
3535

3636
if dim == 0 and value is not None:
3737
col = src.storage.col()
38-
return scatter(value, col, dim=0, dim_size=src.size(0))
38+
return scatter(value, col, 0, None, src.size(1), reduce)
3939
elif dim == 0 and value is None:
4040
if reduce == 'sum' or reduce == 'add':
4141
return src.storage.colcount().to(src.dtype())

torch_sparse/tensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def from_torch_sparse_coo_tensor(self, mat: torch.Tensor,
6666

6767
value: Optional[torch.Tensor] = None
6868
if has_value:
69-
value = mat._values()
69+
value = mat.values()
7070

7171
return SparseTensor(row=row, rowptr=None, col=col, value=value,
7272
sparse_sizes=(mat.size(0), mat.size(1)),

0 commit comments

Comments
 (0)