def test_torch_quant(self):
        r"""
        Test that a simple `torch.quantization.quantize_dynamic` call works on a T5 model.
        """
        model_name = "google/flan-t5-small"
        tokenizer = T5Tokenizer.from_pretrained(model_name)
        model = T5ForConditionalGeneration.from_pretrained(model_name)
        model = torch.quantization.quantize_dynamic(model, {torch.nn.Linear}, dtype=torch.qint8)
        input_text = "Answer the following yes/no question by reasoning step-by-step. Can you write a whole Haiku in a single tweet?"
        input_ids = tokenizer(input_text, return_tensors="pt").input_ids
        _ = model.generate(input_ids)

        Test that a simple `torch.quantization.quantize_dynamic` call works on a T5 model.
        
dpkd/transformers/tests/models/t5/test_modeling_t5.py