code: def test_to_dataclass():
      from torch_geometric.transforms import AddSelfLoops
  
      AddSelfLoopsConfig = to_dataclass(AddSelfLoops, with_target=True)
      assert AddSelfLoopsConfig.__name__ == "AddSelfLoops"
  
      fields = AddSelfLoopsConfig.__dataclass_fields__
  
      assert fields["attr"].name == "attr"
      assert fields["attr"].type == str
      assert fields["attr"].default == "edge_weight"
  
      assert fields["fill_value"].name == "fill_value"
      assert fields["fill_value"].type == Any
      assert fields["fill_value"].default == 1.0
  
      assert fields["_target_"].name == "_target_"
      assert fields["_target_"].type == str
      assert fields["_target_"].default == (
          "torch_geometric.transforms.add_self_loops.AddSelfLoops"
      )
  
      cfg = AddSelfLoopsConfig()
      assert str(cfg) == (
          "AddSelfLoops(attr='edge_weight', fill_value=1.0, "
          "_target_='torch_geometric.transforms.add_self_loops."
          "AddSelfLoops')"
      )
  
file_path: pytorch_geometric/test/test_config_store.py
imports: from typing import Any
  from torch_geometric.config_store import class_from_dataclass, clear_config_store, dataclass_from_class, fill_config_store, get_config_store, register, to_dataclass
  from torch_geometric.testing import withPackage
  from torch_geometric.transforms import AddSelfLoops
label_desc: Use image node_id 2 for calling a global function with example usage: test_to_dataclass() without return types