code: def test_lm_head_ignore_keys(self):
      keys_to_ignore_on_save_tied = [
          r"lm_head.decoder.weight",
          r"lm_head.decoder.bias",
      ]
      keys_to_ignore_on_save_untied = [r"lm_head.decoder.bias"]
      config = RobertaConfig.from_pretrained(ROBERTA_TINY)
      config_tied = deepcopy(config)
      config_tied.tie_word_embeddings = True
      config_untied = deepcopy(config)
      config_untied.tie_word_embeddings = False
      for cls in [RobertaForMaskedLM, RobertaForCausalLM]:
          model = cls(config_tied)
          self.assertEqual(
              model._keys_to_ignore_on_save,
              keys_to_ignore_on_save_tied,
              cls,
          )
  
          # the keys should be different when embeddings aren't tied
          model = cls(config_untied)
          self.assertEqual(
              model._keys_to_ignore_on_save,
              keys_to_ignore_on_save_untied,
              cls,
          )
  
          # test that saving works with updated ignore keys - just testing that it doesn't fail
          model.save_pretrained(self.get_auto_remove_tmp_dir())
  
imports: import unittest
  from copy import deepcopy
  from transformers import RobertaConfig, is_torch_available
  from transformers.testing_utils import TestCasePlus, require_torch, slow, torch_device
  from ...generation.test_generation_utils import GenerationTesterMixin
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
label_desc: Use image node_id 4 for calling the RobertaModelIntegrationTest obj's underlying member method code with example usage: obj.test_lm_head_ignore_keys() without return types