code: def test_save_load_in_bf16(self):
      (
          config,
          _,
      ) = self.model_tester.prepare_config_and_inputs_for_common()
  
      for model_class in self.all_model_classes:
          model = model_class(config)
  
      # convert weights to bf16 and save
      params = model.to_bf16(model.params)
      with tempfile.TemporaryDirectory() as tmpdirname:
          model.save_pretrained(tmpdirname, params=params)
  
          # load the weights again and check if they are still in fp16
          model = model_class.from_pretrained(tmpdirname)
          types = flatten_dict(
              jax.tree_util.tree_map(lambda x: x.dtype, model.params)
          )
          for name, type_ in types.items():
              self.assertEqual(
                  type_,
                  jnp.bfloat16,
                  msg=f"param {name} is not in bf16.",
              )
  
imports: import copy
  import inspect
  import json
  import random
  import tempfile
  from typing import List, Tuple
  import numpy
  import transformers
  from transformers import is_flax_available, is_torch_available
  from transformers.models.auto import get_values
  from transformers.testing_utils import CaptureLogger, is_pt_flax_cross_test, require_flax, torch_device
  from transformers.utils import CONFIG_NAME, GENERATION_CONFIG_NAME, logging
  from transformers.utils.generic import ModelOutput
label_desc: Use image node_id 24 for calling the FlaxModelTesterMixin obj's underlying member method code with example usage: obj.test_save_load_in_bf16() without return types