docstr: Function to rewrite the checkpoint in place to give the model a chance
  to update state_dict keys. This assumes that checkpoint is the
  model's state_dict.
docstr_tok: ["Function","to","rewrite","the","checkpoint","in","place","to","give","the","model","a","chance","to","update","state_dict","keys",".","This","assumes","that","checkpoint","is","the","model","'s","state_dict","."]
code: def _update_model_format_state_keys(
      self, checkpoint: Dict[str, Any], model: torch.nn.Module
  ) -> None:
      """
      Function to rewrite the checkpoint in place to give the model a chance
      to update state_dict keys. This assumes that checkpoint is the
      model's state_dict.
      """
      tmp_state_dict = dict(checkpoint)
      for attr in tmp_state_dict:
          new_attr = _format_state_key(model, attr)
          if attr != new_attr:
              logger.info(
                  f"checkpoint: rewriting {attr} into {new_attr}"
              )
              value = checkpoint.pop(attr)
              checkpoint[new_attr] = value
  
file_path: mmf/mmf/utils/checkpoint_updater.py
imports: import logging
  from typing import Any, Dict, Tuple
  import torch
  from mmf.common.registry import registry
label_desc: Use image node_id 6 for calling the MMFToPLCheckpointUpdater obj's underlying member method code with example usage: obj._update_model_format_state_keys(checkpoint, model) without return types