code: def test_load_save_without_tied_weights(self):
      (
          config,
          _,
      ) = self.model_tester.prepare_config_and_inputs_for_common()
      config.text_config.tie_word_embeddings = False
      for model_class in self.all_model_classes:
          model = model_class(config)
          with tempfile.TemporaryDirectory() as d:
              model.save_pretrained(d)
  
              model_reloaded, infos = model_class.from_pretrained(
                  d, output_loading_info=True
              )
              # Checking the state dicts are correct
              reloaded_state = model_reloaded.state_dict()
              for k, v in model.state_dict().items():
                  self.assertIn(
                      k,
                      reloaded_state,
                      f"Key {k} is missing from reloaded",
                  )
                  torch.testing.assert_close(
                      v,
                      reloaded_state[k],
                      msg=lambda x: f"{model_class.__name__}: Tensor {k}: {x}",
                  )
              # Checking there was no complain of missing weights
              self.assertEqual(infos["missing_keys"], [])
  
imports: import copy
  import inspect
  import os
  import tempfile
  import unittest
  import numpy
  import requests
  from transformers import AutoModelForVision2Seq, AutoProcessor, Kosmos2Config
  from transformers.models.kosmos2.configuration_kosmos2 import Kosmos2TextConfig, Kosmos2VisionConfig
  from transformers.testing_utils import require_torch, require_vision, slow, torch_device
  from transformers.utils import is_torch_available, is_vision_available
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, _config_zero_init, floats_tensor, ids_tensor, random_attention_mask
  from ...test_pipeline_mixin import PipelineTesterMixin
label_desc: Use image node_id 7 for calling the Kosmos2ModelTest obj's underlying member method code with example usage: obj.test_load_save_without_tied_weights() without return types