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
a6c739df
"torchvision/models/vscode:/vscode.git/clone" did not exist on "90645ccd0e774ad76200245e32222a23d09f2312"
Commit
a6c739df
authored
Feb 15, 2020
by
rusty1s
Browse files
fix for pytorch 1.3
parent
c4ea8364
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
torch_sparse/tensor.py
torch_sparse/tensor.py
+4
-4
No files found.
torch_sparse/tensor.py
View file @
a6c739df
...
@@ -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
):
...
...
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