code: def test_save_load_to_base_pt(self):
      (
          config,
          _,
      ) = self.model_tester.prepare_config_and_inputs_for_common()
      base_class = FLAX_MODEL_MAPPING[config.__class__]
  
      for model_class in self.all_model_classes:
          if model_class == base_class:
              continue
  
          model = model_class(config)
          base_params_from_head = flatten_dict(unfreeze(model.params))
  
          # convert Flax model to PyTorch model
          pt_model_class = getattr(
              transformers, model_class.__name__[4:]
          )  # Skip the "Flax" at the beginning
          pt_model = pt_model_class(config).eval()
          pt_model = load_flax_weights_in_pytorch_model(
              pt_model, model.params
          )
  
          # check that all base model weights are loaded correctly
          with tempfile.TemporaryDirectory() as tmpdirname:
              pt_model.save_pretrained(tmpdirname)
              base_model = base_class.from_pretrained(
                  tmpdirname, from_pt=True
              )
  
              base_params = flatten_dict(unfreeze(base_model.params))
  
              for key in base_params_from_head.keys():
                  max_diff = (
                      (base_params[key] - base_params_from_head[key])
                      .sum()
                      .item()
                  )
                  self.assertLessEqual(
                      max_diff, 1e-3, msg=f"{key} not identical"
                  )
  
imports: import tempfile
  import unittest
  import numpy
  import transformers
  from transformers import is_flax_available
  from transformers.testing_utils import is_pt_flax_cross_test, require_flax, require_sentencepiece, require_tokenizers, slow
  from ...generation.test_flax_utils import FlaxGenerationTesterMixin
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_flax_common import FlaxModelTesterMixin, ids_tensor
label_desc: Use image node_id 9 for calling the FlaxT5EncoderOnlyModelTest obj's underlying member method code with example usage: obj.test_save_load_to_base_pt() without return types