Skip to content

Commit 83b667e

Browse files
committed
allclose
1 parent 20a7cd3 commit 83b667e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/test_std.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ def test_std(dtype, device, bias):
1515
index = tensor([[0, 0, 0, 0, 0], [1, 1, 1, 1, 1]], torch.long, device)
1616

1717
out = scatter_std(src, index, dim=-1, unbiased=bias)
18-
expected = src.std(dim=-1, unbiased=bias)
19-
assert out.tolist() == [[expected[0].item(), 0], [0, expected[0].item()]]
18+
std = src.std(dim=-1, unbiased=bias)[0].item()
19+
expected = torch.tensor([[std, 0], [0, std]], dtype=out.dtype)
20+
assert torch.allclose(out, expected)

0 commit comments

Comments
 (0)