class_docstr: GPT-2 Language model.
class_docstr_tok: ["GPT-2","Language","model","."]
code: def state_dict_for_save_checkpoint(
      self, destination=None, prefix="", keep_vars=False
  ):
      state_dict_ = {}
      state_dict_[
          self._language_model_key
      ] = self.language_model.state_dict_for_save_checkpoint(
          destination, prefix, keep_vars
      )
      # Save word_embeddings.
      if self.post_process and not self.pre_process:
          state_dict_[
              self._word_embeddings_for_head_key
          ] = self.word_embeddings.state_dict(
              destination, prefix, keep_vars
          )
      return state_dict_
  
file_path: NeMo/nemo/collections/nlp/models/language_modeling/megatron/gpt_model.py
imports: import torch
  from nemo.collections.nlp.modules.common.megatron.language_model import get_language_model
  from nemo.collections.nlp.modules.common.megatron.module import MegatronModule
  from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults, init_method_normal, parallel_lm_logits, scaled_init_method_normal
label_desc: Use image node_id 4 for calling the GPTModel obj's underlying member method code with example usage: obj.state_dict_for_save_checkpoint(destination, prefix, keep_vars) and returns: state_dict_