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-scatter
Commits
a8e3e285
Commit
a8e3e285
authored
Mar 12, 2019
by
rusty1s
Browse files
tensors need to be on the same device for comparison
parent
83b667ef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
test/test_std.py
test/test_std.py
+1
-1
No files found.
test/test_std.py
View file @
a8e3e285
...
@@ -16,5 +16,5 @@ def test_std(dtype, device, bias):
...
@@ -16,5 +16,5 @@ def test_std(dtype, device, bias):
out
=
scatter_std
(
src
,
index
,
dim
=-
1
,
unbiased
=
bias
)
out
=
scatter_std
(
src
,
index
,
dim
=-
1
,
unbiased
=
bias
)
std
=
src
.
std
(
dim
=-
1
,
unbiased
=
bias
)[
0
].
item
()
std
=
src
.
std
(
dim
=-
1
,
unbiased
=
bias
)[
0
].
item
()
expected
=
torch
.
tensor
([[
std
,
0
],
[
0
,
std
]],
dtype
=
out
.
dtyp
e
)
expected
=
tensor
([[
std
,
0
],
[
0
,
std
]],
dtype
,
devic
e
)
assert
torch
.
allclose
(
out
,
expected
)
assert
torch
.
allclose
(
out
,
expected
)
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