We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20a7cd3 commit 83b667eCopy full SHA for 83b667e
test/test_std.py
@@ -15,5 +15,6 @@ def test_std(dtype, device, bias):
15
index = tensor([[0, 0, 0, 0, 0], [1, 1, 1, 1, 1]], torch.long, device)
16
17
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()]]
+ std = src.std(dim=-1, unbiased=bias)[0].item()
+ expected = torch.tensor([[std, 0], [0, std]], dtype=out.dtype)
20
+ assert torch.allclose(out, expected)
0 commit comments