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
fca68194
Commit
fca68194
authored
Jan 11, 2021
by
rusty1s
Browse files
fix test on pytorch 1.6.0
parent
947e0369
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
test/test_matmul.py
test/test_matmul.py
+4
-4
No files found.
test/test_matmul.py
View file @
fca68194
...
@@ -51,12 +51,12 @@ def test_spmm_half_precision():
...
@@ -51,12 +51,12 @@ def test_spmm_half_precision():
src_dense
[:,
2
:
4
]
=
0
# Remove multiple columns.
src_dense
[:,
2
:
4
]
=
0
# Remove multiple columns.
src
=
SparseTensor
.
from_dense
(
src_dense
)
src
=
SparseTensor
.
from_dense
(
src_dense
)
other
=
torch
.
randn
((
2
,
8
,
2
),
dtype
=
torch
.
half
,
device
=
'cpu'
)
other
=
torch
.
randn
((
2
,
8
,
2
),
dtype
=
torch
.
float
,
device
=
'cpu'
)
expected
=
src_dense
@
other
expected
=
(
src_dense
.
to
(
torch
.
float
)
@
other
).
to
(
torch
.
half
)
out
=
src
@
other
out
=
src
@
other
.
to
(
torch
.
half
)
assert
torch
.
allclose
(
expected
,
out
,
atol
=
1e-
6
)
assert
torch
.
allclose
(
expected
,
out
,
atol
=
1e-
2
)
@
pytest
.
mark
.
parametrize
(
'dtype,device'
,
product
(
grad_dtypes
,
devices
))
@
pytest
.
mark
.
parametrize
(
'dtype,device'
,
product
(
grad_dtypes
,
devices
))
...
...
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