code: def test_validate():
      x = torch.randn(6, 16)
      index = torch.tensor([0, 0, 1, 1, 1, 2])
      ptr = torch.tensor([0, 2, 5, 6])
  
      aggr = MeanAggregation()
  
      with pytest.raises(ValueError, match="invalid dimension"):
          aggr(x, index, dim=-3)
  
      with pytest.raises(ValueError, match="invalid 'dim_size'"):
          aggr(x, ptr=ptr, dim_size=2)
  
      with pytest.raises(ValueError, match="invalid 'dim_size'"):
          aggr(x, index, dim_size=2)
  
file_path: pytorch_geometric/test/nn/aggr/test_basic.py
imports: import pytest
  import torch
  import torch_geometric.typing
  from torch_geometric.nn import MaxAggregation, MeanAggregation, MinAggregation, MulAggregation, PowerMeanAggregation, SoftmaxAggregation, StdAggregation, SumAggregation, VarAggregation
label_desc: Use image node_id 1 for calling a global function with example usage: test_validate() without return types