class_docstr: The Graphormer model is a graph-encoder model.
  
  It goes from a graph to its representation. If you want to use the model for a downstream classification task, use
  GraphormerForGraphClassification instead. For any other downstream task, feel free to add a new class, or combine
  this model with a downstream model of your choice, following the example in GraphormerForGraphClassification.
class_docstr_tok: ["The","Graphormer","model","is","a","graph-encoder","model",".","It","goes","from","a","graph","to","its","representation",".","If","you","want","to","use","the","model","for","a","downstream","classification","task",",","use","GraphormerForGraphClassification","instead",".","For","any","other","downstream","task",",","feel","free","to","add","a","new","class",",","or","combine","this","model","with","a","downstream","model","of","your","choice",",","following","the","example","in","GraphormerForGraphClassification","."]
code: def __init__(self, config: GraphormerConfig):
      super().__init__(config)
      self.max_nodes = config.max_nodes
  
      self.graph_encoder = GraphormerGraphEncoder(config)
  
      self.share_input_output_embed = config.share_input_output_embed
      self.lm_output_learned_bias = None
  
      # Remove head is set to true during fine-tuning
      self.load_softmax = not getattr(config, "remove_head", False)
  
      self.lm_head_transform_weight = nn.Linear(
          config.embedding_dim, config.embedding_dim
      )
      self.activation_fn = ACT2FN[config.activation_fn]
      self.layer_norm = nn.LayerNorm(config.embedding_dim)
  
      self.post_init()
  
imports: import math
  from typing import Iterable, Iterator, List, Optional, Tuple, Union
  import torch
  import torch.nn
  from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
  from ...activations import ACT2FN
  from ...modeling_outputs import BaseModelOutputWithNoAttention, SequenceClassifierOutput
  from ...modeling_utils import PreTrainedModel
  from ...utils import logging
  from .configuration_graphormer import GraphormerConfig
label_desc: Use image node_id 1 to create a new GraphormerModel object from inherited base classes: GraphormerPreTrainedModel with example: obj = GraphormerModel(config)