code: def test_from_save_pretrained_dtype(self):
      (
          init_dict,
          inputs_dict,
      ) = self.prepare_init_args_and_inputs_for_common()
  
      model = self.model_class(**init_dict)
      model.to(torch_device)
      model.eval()
  
      for dtype in [torch.float32, torch.float16, torch.bfloat16]:
          if torch_device == "mps" and dtype == torch.bfloat16:
              continue
          with tempfile.TemporaryDirectory() as tmpdirname:
              model.to(dtype)
              model.save_pretrained(
                  tmpdirname, safe_serialization=False
              )
              new_model = self.model_class.from_pretrained(
                  tmpdirname, low_cpu_mem_usage=True, torch_dtype=dtype
              )
              assert new_model.dtype == dtype
              new_model = self.model_class.from_pretrained(
                  tmpdirname, low_cpu_mem_usage=False, torch_dtype=dtype
              )
              assert new_model.dtype == dtype
  
imports: import inspect
  import tempfile
  import traceback
  import unittest
  import unittest.mock
  import uuid
  from typing import Dict, List, Tuple
  import numpy
  import requests_mock
  import torch
  from huggingface_hub import delete_repo
  from requests.exceptions import HTTPError
  from diffusers.models import UNet2DConditionModel
  from diffusers.models.attention_processor import AttnProcessor, AttnProcessor2_0, XFormersAttnProcessor
  from diffusers.training_utils import EMAModel
  from diffusers.utils import is_xformers_available, logging
  from diffusers.utils.testing_utils import CaptureLogger, require_python39_or_higher, require_torch_2, require_torch_gpu, run_test_in_subprocess, torch_device
  from ..others.test_utils import TOKEN, USER, is_staging_test
label_desc: Use image node_id 7 for calling the ModelTesterMixin obj's underlying member method code with example usage: obj.test_from_save_pretrained_dtype() without return types