class_docstr: Base language module that has common helper functions used across GPT, BERT etc.
  
  Args:
      config (TransformerConfig): Input transformer config for the model
class_docstr_tok: ["Base","language","module","that","has","common","helper","functions","used","across","GPT",",","BERT","etc",".","Args",":","config","(","TransformerConfig",")",":","Input","transformer","config","for","the","model"]
docstr: Gets the emedding weight or output logit weights when share embedding and output weights set to True.
  
  Returns:
      Tensor: During pre processing it returns the input embeddings weight while during post processing it returns the final output layers weight
docstr_tok: ["Gets","the","emedding","weight","or","output","logit","weights","when","share","embedding","and","output","weights","set","to","True",".","Returns",":","Tensor",":","During","pre","processing","it","returns","the","input","embeddings","weight","while","during","post","processing","it","returns","the","final","output","layers","weight"]
code: def shared_embedding_or_output_weight(self) -> Tensor:
      """Gets the emedding weight or output logit weights when share embedding and output weights set to True.
  
      Returns:
          Tensor: During pre processing it returns the input embeddings weight while during post processing it returns the final output layers weight
      """
      if self.pre_process:
          return self.embedding.word_embeddings.weight
      elif self.post_process:
          return self.output_layer.weight
      return None
  
file_path: megatron-lm/megatron/core/models/common/language_module/language_module.py
imports: import logging
  import torch
  from torch import Tensor
  from megatron.core import parallel_state, tensor_parallel
  from megatron.core.transformer.module import MegatronModule
  from megatron.core.transformer.transformer_config import TransformerConfig
label_desc: Use image node_id 4 for calling the LanguageModule obj's underlying member method code with example usage: obj.shared_embedding_or_output_weight() and returns: None, self, self