class_docstr: General GNN model
docstr: Parameters:
  node_encoding_classes - For integer features, gives the number
  of possible integer features to map.
docstr_tok: ["Parameters",":","node_encoding_classes","-","For","integer","features",",","gives","the","number","of","possible","integer","features","to","map","."]
code: def __init__(self, dim_in, dim_out, **kwargs):
      """
      Parameters:
      node_encoding_classes - For integer features, gives the number
      of possible integer features to map.
      """
      super(GNN, self).__init__()
      GNNStage = stage_dict[cfg.gnn.stage_type]
      GNNHead = head_dict[cfg.dataset.task]
  
      if cfg.dataset.node_encoder:
          # Encode integer node features via nn.Embeddings
          NodeEncoder = node_encoder_dict[cfg.dataset.node_encoder_name]
          self.node_encoder = NodeEncoder(cfg.dataset.encoder_dim)
          if cfg.dataset.node_encoder_bn:
              self.node_encoder_bn = BatchNorm1dNode(
                  cfg.dataset.encoder_dim
              )
          # Update dim_in to reflect the new dimension fo the node features
          dim_in = cfg.dataset.encoder_dim
      if cfg.dataset.edge_encoder:
          # Encode integer edge features via nn.Embeddings
          EdgeEncoder = edge_encoder_dict[cfg.dataset.edge_encoder_name]
          self.edge_encoder = EdgeEncoder(cfg.dataset.encoder_dim)
          if cfg.dataset.edge_encoder_bn:
              self.edge_encoder_bn = BatchNorm1dEdge(
                  cfg.dataset.edge_dim
              )
  
      self.preprocess = Preprocess(dim_in)
      d_in = self.preprocess.dim_out
      if cfg.gnn.layers_pre_mp > 0:
          self.pre_mp = GNNPreMP(d_in, cfg.gnn.dim_inner)
          d_in = cfg.gnn.dim_inner
      if cfg.gnn.layers_mp > 0:
          self.mp = GNNStage(
              dim_in=d_in,
              dim_out=cfg.gnn.dim_inner,
              num_layers=cfg.gnn.layers_mp,
          )
          d_in = self.mp.dim_out
      self.post_mp = GNNHead(dim_in=d_in, dim_out=dim_out)
  
      self.apply(init_weights)
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  import graphgym.register
  from graphgym.config import cfg
  from graphgym.init import init_weights
  from graphgym.models.act import act_dict
  from graphgym.models.feature_augment import Preprocess
  from graphgym.models.feature_encoder import edge_encoder_dict, node_encoder_dict
  from graphgym.models.head import head_dict
  from graphgym.models.layer import BatchNorm1dEdge, BatchNorm1dNode, GeneralLayer, GeneralMultiLayer
label_desc: Use image node_id 1 to create a new GNN object from inherited base classes: nn with example: obj = GNN(dim_in, dim_out)