Skip to content

Commit a6c739d

Browse files
committed
fix for pytorch 1.3
1 parent c4ea836 commit a6c739d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

torch_sparse/tensor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,8 @@ def __repr__(self: SparseTensor) -> str:
512512

513513
# Scipy Conversions ###########################################################
514514

515-
ScipySparseMatrix = Union[scipy.sparse.coo_matrix, scipy.sparse.
516-
csr_matrix, scipy.sparse.csc_matrix]
515+
ScipySparseMatrix = Union[scipy.sparse.coo_matrix, scipy.sparse.csr_matrix,
516+
scipy.sparse.csc_matrix]
517517

518518

519519
@torch.jit.ignore
@@ -574,11 +574,11 @@ def to_scipy(self: SparseTensor, layout: Optional[str] = None,
574574

575575
# Hacky fixes #################################################################
576576

577-
# Fix standard operators of `torch.Tensor` for PyTorch<=1.4.
577+
# Fix standard operators of `torch.Tensor` for PyTorch<=1.3.
578578
# https://github.com/pytorch/pytorch/pull/31769
579579
TORCH_MAJOR = int(torch.__version__.split('.')[0])
580580
TORCH_MINOR = int(torch.__version__.split('.')[1])
581-
if (TORCH_MAJOR < 1) or (TORCH_MAJOR == 1 and TORCH_MINOR <= 4):
581+
if (TORCH_MAJOR < 1) or (TORCH_MAJOR == 1 and TORCH_MINOR <= 3):
582582

583583
def add(self, other):
584584
if torch.is_tensor(other) or is_scalar(other):

0 commit comments

Comments
 (0)