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
26fa1b3e
"docs/source/vscode:/vscode.git/clone" did not exist on "6f9ae8d61eca4a2841bb06b47a993c523de6f43c"
Commit
26fa1b3e
authored
Oct 07, 2020
by
rusty1s
Browse files
typo
parent
2ab84ed5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
torch_sparse/tensor.py
torch_sparse/tensor.py
+5
-5
No files found.
torch_sparse/tensor.py
View file @
26fa1b3e
...
...
@@ -123,7 +123,7 @@ class SparseTensor(object):
def
clone
(
self
):
return
self
.
from_storage
(
self
.
storage
.
clone
())
def
type_as
(
self
,
tensor
=
torch
.
Tensor
):
def
type_as
(
self
,
tensor
:
torch
.
Tensor
):
value
=
self
.
storage
.
value
()
if
value
is
None
or
tensor
.
dtype
==
value
.
dtype
:
return
self
...
...
@@ -397,8 +397,8 @@ class SparseTensor(object):
return
mat
def
to_torch_sparse_coo_tensor
(
self
,
dtype
:
Optional
[
int
]
=
None
)
->
torch
.
Tensor
:
def
to_torch_sparse_coo_tensor
(
self
,
dtype
:
Optional
[
int
]
=
None
)
->
torch
.
Tensor
:
row
,
col
,
value
=
self
.
coo
()
index
=
torch
.
stack
([
row
,
col
],
dim
=
0
)
...
...
@@ -505,8 +505,8 @@ SparseTensor.__repr__ = __repr__
# Scipy Conversions ###########################################################
ScipySparseMatrix
=
Union
[
scipy
.
sparse
.
coo_matrix
,
scipy
.
sparse
.
csr_matrix
,
scipy
.
sparse
.
csc_matrix
]
ScipySparseMatrix
=
Union
[
scipy
.
sparse
.
coo_matrix
,
scipy
.
sparse
.
csr_matrix
,
scipy
.
sparse
.
csc_matrix
]
@
torch
.
jit
.
ignore
...
...
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