"vscode:/vscode.git/clone" did not exist on "c1f6bbab5582957d8ddfb487f9df02e81560e93e"
Commit a8e3e285 authored by rusty1s's avatar rusty1s
Browse files

tensors need to be on the same device for comparison

parent 83b667ef
...@@ -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.dtype) expected = tensor([[std, 0], [0, std]], dtype, device)
assert torch.allclose(out, expected) assert torch.allclose(out, expected)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment