docstr: Test whether it is possible to mix both `int8` and `fp32` weights when using `keep_in_fp32_modules` correctly.
docstr_tok: ["Test","whether","it","is","possible","to","mix","both","`","int8","`","and","`","fp32","`","weights","when","using","`","keep_in_fp32_modules","`","correctly","."]
code: def test_fp32_int8_conversion(self):
      r"""
      Test whether it is possible to mix both `int8` and `fp32` weights when using `keep_in_fp32_modules` correctly.
      """
      model = AutoModelForSeq2SeqLM.from_pretrained(
          "t5-small", load_in_8bit=True, device_map="auto"
      )
      self.assertTrue(
          model.decoder.block[0].layer[2].DenseReluDense.wo.weight.dtype
          == torch.float32
      )
  
imports: import gc
  import importlib.metadata
  import tempfile
  import unittest
  from packaging import version
  from transformers import AutoConfig, AutoModel, AutoModelForCausalLM, AutoModelForSeq2SeqLM, AutoModelForSequenceClassification, AutoTokenizer, BitsAndBytesConfig, pipeline
  from transformers.testing_utils import is_accelerate_available, is_torch_available, require_accelerate, require_bitsandbytes, require_torch, require_torch_gpu, require_torch_multi_gpu, slow
label_desc: Use image node_id 14 for calling the MixedInt8Test obj's underlying member method code with example usage: obj.test_fp32_int8_conversion() without return types