code: def testModelEndToEnd(self, model_fn):
      # 1. Check whether quantized model graph can be constructed.
      model = model_fn(self)
      model = quantize.quantize_model(model)
  
      # 2. Sanity check to ensure basic training on random data works.
      x_train, y_train = self._create_test_data(model)
      model.compile(loss="mse", optimizer="sgd", metrics=["accuracy"])
      model.fit(x_train, y_train, epochs=100)
  
      x_test, y_test = self._create_test_data(model)
  
      y_tf = model.predict(x_test)
  
      # 3. Ensure conversion to TFLite works.
      _, tflite_file = tempfile.mkstemp(".tflite")
      print("TFLite File: ", tflite_file)
      with quantize.quantize_scope():
          utils.convert_keras_to_tflite(model, tflite_file)
  
      # 4. Verify input runs on converted model.
      y_tfl = self._execute_tflite(tflite_file, x_test, y_test)
  
      # 5. Verify results are the same in TF and TFL.
      # TODO(pulkitb): Temporarily raise tolerances since some rounding
      # changes in x86 kernels are causing values to differ by 'scale'.
      self.assertAllClose(y_tf, y_tfl, atol=1e-1, rtol=1e-1)
  
imports: import tempfile
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.quantization.keras import quantize
  from tensorflow_model_optimization.python.core.quantization.keras import utils
label_desc: Use image node_id 17 for calling the QuantizeNumericalTest obj's underlying member method code with example usage: obj.testModelEndToEnd(model_fn) without return types