"docs/vscode:/vscode.git/clone" did not exist on "f8feee1cc63296447cf0d0b03cf1bfc1aea0dfa9"
Commit a6c739df authored by rusty1s's avatar rusty1s
Browse files

fix for pytorch 1.3

parent c4ea8364
...@@ -512,8 +512,8 @@ SparseTensor.__repr__ = __repr__ ...@@ -512,8 +512,8 @@ SparseTensor.__repr__ = __repr__
# Scipy Conversions ########################################################### # Scipy Conversions ###########################################################
ScipySparseMatrix = Union[scipy.sparse.coo_matrix, scipy.sparse. ScipySparseMatrix = Union[scipy.sparse.coo_matrix, scipy.sparse.csr_matrix,
csr_matrix, scipy.sparse.csc_matrix] scipy.sparse.csc_matrix]
@torch.jit.ignore @torch.jit.ignore
...@@ -574,11 +574,11 @@ SparseTensor.to_scipy = to_scipy ...@@ -574,11 +574,11 @@ SparseTensor.to_scipy = to_scipy
# Hacky fixes ################################################################# # Hacky fixes #################################################################
# Fix standard operators of `torch.Tensor` for PyTorch<=1.4. # Fix standard operators of `torch.Tensor` for PyTorch<=1.3.
# https://github.com/pytorch/pytorch/pull/31769 # https://github.com/pytorch/pytorch/pull/31769
TORCH_MAJOR = int(torch.__version__.split('.')[0]) TORCH_MAJOR = int(torch.__version__.split('.')[0])
TORCH_MINOR = int(torch.__version__.split('.')[1]) TORCH_MINOR = int(torch.__version__.split('.')[1])
if (TORCH_MAJOR < 1) or (TORCH_MAJOR == 1 and TORCH_MINOR <= 4): if (TORCH_MAJOR < 1) or (TORCH_MAJOR == 1 and TORCH_MINOR <= 3):
def add(self, other): def add(self, other):
if torch.is_tensor(other) or is_scalar(other): if torch.is_tensor(other) or is_scalar(other):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment