Repository: pyg-team/pytorch_geometric
Pull request: fix seed in `GraphNorm` tests
solves https://github.com/pyg-team/pytorch_geometric/issues/6622

Problem statement:
failing test_graph_norm
### 🐛 Describe the bug

```
_______________________________ test_graph_norm ________________________________
    def test_graph_norm():
        x = torch.randn(200, 16)
        batch = torch.arange(4).view(-1, 1).repeat(1, 50).view(-1)
    
        norm = GraphNorm(16)
        assert norm.__repr__() == 'GraphNorm(16)'
    
        if is_full_test():
            torch.jit.script(norm)
    
        out = norm(x)
        assert out.size() == (200, 16)
        assert torch.allclose(out.mean(dim=0), torch.zeros(16), atol=1e-6)
        assert torch.allclose(out.std(dim=0, unbiased=False), torch.ones(16),
                              atol=1e-6)
    
        out = norm(x, batch)
        assert out.size() == (200, 16)
        assert torch.allclose(out[:50].mean(dim=0), torch.zeros(16), atol=1e-6)
>       assert torch.allclose(out[:50].std(dim=0, unbiased=False), torch.ones(16),
                              atol=1e-6)
E       assert False
E        +  where False = <built-in method allclose of type object at 0x7fdfae261bc0>(tensor([1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,\n        1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000],\n       grad_fn=<StdBackward0>), tensor([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.]), atol=1e-06)
E        +    where <built-in method allclose of type object at 0x7fdfae261bc0> = torch.allclose
E        +    and   tensor([1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,\n        1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000],\n       grad_fn=<StdBackward0>) = <built-in method std of Tensor object at 0x7fe10b57b680>(dim=0, unbiased=False)
E        +      where <built-in method std of Tensor object at 0x7fe10b57b680> = tensor([[ 1.3152,  2.1180, -0.2363, -0.0826, -1.7864, -1.6540,  0.3225, -0.5138,\n          0.4043, -0.9715,  0.0435,  ...03,\n          0.3199,  0.8352,  0.2442, -0.6816, -1.4514,  1.5867, -0.0306,  0.6499]],\n       grad_fn=<SliceBackward0>).std
E        +    and   tensor([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.]) = <built-in method ones of type object at 0x7fdfae261bc0>(16)
E        +      where <built-in method ones of type object at 0x7fdfae261bc0> = torch.ones
test/nn/norm/test_graph_norm.py:26: AssertionError
```

### Environment

* PyG version: latest build
* CUDA/cuDNN version: 12

Hints from issue discussion:
might just need a tolerance change for cuda.
Does lowering `atol` helps?
so if i run it w/ `py.test -s test/nn/norm/test_graph_norm.py -v` or `pytest --cov --cov-report=xml` the test passes but if i run w/ `FULL_TEST=1 pytest --cov --cov-report=xml` i repro the issue. this implies a bad seed to me. [this PR](https://github.com/pyg-team/pytorch_geometric/pull/6642) should fix it

Commit message: [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Patch to review:
diff --git a/test/nn/norm/test_graph_norm.py b/test/nn/norm/test_graph_norm.py
index a233c337fab4..9e01023260bb 100644
--- a/test/nn/norm/test_graph_norm.py
+++ b/test/nn/norm/test_graph_norm.py
@@ -1,10 +1,12 @@
 import torch
 
+from torch_geometric import seed_everything
 from torch_geometric.nn import GraphNorm
 from torch_geometric.testing import is_full_test
 
 
 def test_graph_norm():
+    seed_everything(42)
     x = torch.randn(200, 16)
     batch = torch.arange(4).view(-1, 1).repeat(1, 50).view(-1)
 


Code review comments:
diff_hunk: @@ -1,10 +1,12 @@
 import torch
 
+from torch_geometric import seed_everything
 from torch_geometric.nn import GraphNorm
 from torch_geometric.testing import is_full_test
 
 
 def test_graph_norm():
+    seed_everything(42)
path: test/nn/norm/test_graph_norm.py
text: @user1:
```suggestion
from torch_geometric.nn import GraphNorm
from torch_geometric.testing import is_full_test


def test_graph_norm():
    torch.manual_seed(42)
```