code: def test_from_pretrained_with_no_automatic_init(self):
      (
          config,
          inputs_dict,
      ) = self.model_tester.prepare_config_and_inputs_for_common()
      config.return_dict = True
  
      def _assert_all_params_initialised(model, params):
          # Check if all required parmas are loaded
          keys = set(flatten_dict(unfreeze(params)).keys())
          self.assertTrue(all(k in keys for k in model.required_params))
          # Check if the shapes match
          flat_params = flatten_dict(unfreeze(params))
          for k, v in flatten_dict(
              unfreeze(model.params_shape_tree)
          ).items():
              self.assertEqual(
                  v.shape,
                  flat_params[k].shape,
                  "Shapes of {} do not match. Expecting {}, got {}.".format(
                      k, v.shape, flat_params[k].shape
                  ),
              )
  
      for model_class in self.all_model_classes:
          # init the model
          model = model_class(config)
  
          # save the model in the temporary directory
          # load the saved model with _do_init=False
          with tempfile.TemporaryDirectory() as tmpdirname:
              model.save_pretrained(tmpdirname)
              model, params = model_class.from_pretrained(
                  tmpdirname, _do_init=False
              )
  
          # Check that accesing parmas raises an ValueError when _do_init is False
          with self.assertRaises(ValueError):
              params = model.params
  
          # Check if all required parmas are loaded
          _assert_all_params_initialised(model, params)
  
          # Check that setting params raises an ValueError when _do_init is False
          with self.assertRaises(ValueError):
              model.params = params
  
          # Check if init_weights initializes missing keys from from_pretrained
          flat_params = flatten_dict(unfreeze(params))
          random_key = random.choice(list(flat_params.keys()))
          flat_params.pop(random_key)
          params = freeze(unflatten_dict(flat_params))
  
          with tempfile.TemporaryDirectory() as tmpdirname:
              model.save_pretrained(tmpdirname, params=params)
              model, params = model_class.from_pretrained(
                  tmpdirname, _do_init=False
              )
  
              params = model.init_weights(
                  model.key, model.input_shape, params=params
              )
              # Check if all required parmas are loaded
              _assert_all_params_initialised(model, params)
  
imports: import copy
  import inspect
  import json
  import random
  import tempfile
  import unittest
  from typing import List, Tuple
  import numpy
  import transformers
  from huggingface_hub import HfFolder, delete_repo, set_access_token
  from requests.exceptions import HTTPError
  from transformers import BertConfig, is_flax_available, is_torch_available
  from transformers.models.auto import get_values
  from transformers.testing_utils import TOKEN, USER, CaptureLogger, is_pt_flax_cross_test, is_staging_test, require_flax, torch_device
  from transformers.utils import logging
  from transformers.utils.generic import ModelOutput
label_desc: Use image node_id 28 for calling the FlaxModelTesterMixin obj's underlying member method code with example usage: obj.test_from_pretrained_with_no_automatic_init() without return types