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
83b667ef
Commit
83b667ef
authored
Mar 10, 2019
by
rusty1s
Browse files
allclose
parent
20a7cd3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
test/test_std.py
test/test_std.py
+3
-2
No files found.
test/test_std.py
View file @
83b667ef
...
@@ -15,5 +15,6 @@ def test_std(dtype, device, bias):
...
@@ -15,5 +15,6 @@ def test_std(dtype, device, bias):
index
=
tensor
([[
0
,
0
,
0
,
0
,
0
],
[
1
,
1
,
1
,
1
,
1
]],
torch
.
long
,
device
)
index
=
tensor
([[
0
,
0
,
0
,
0
,
0
],
[
1
,
1
,
1
,
1
,
1
]],
torch
.
long
,
device
)
out
=
scatter_std
(
src
,
index
,
dim
=-
1
,
unbiased
=
bias
)
out
=
scatter_std
(
src
,
index
,
dim
=-
1
,
unbiased
=
bias
)
expected
=
src
.
std
(
dim
=-
1
,
unbiased
=
bias
)
std
=
src
.
std
(
dim
=-
1
,
unbiased
=
bias
)[
0
].
item
()
assert
out
.
tolist
()
==
[[
expected
[
0
].
item
(),
0
],
[
0
,
expected
[
0
].
item
()]]
expected
=
torch
.
tensor
([[
std
,
0
],
[
0
,
std
]],
dtype
=
out
.
dtype
)
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