code: def _check_tflite_conversion(model, integer_only_quant):
      # This function is for checking the tflite model conversion and accuracy of
      # tflite evaluation.
      (x_train, _), (x_test, y_test) = _get_dataset()
  
      def representative_data_gen():
          for input_value in (
              tf.data.Dataset.from_tensor_slices(x_train)
              .batch(1)
              .take(100)
          ):
              yield [input_value]
  
      if integer_only_quant:
          converter = tf.lite.TFLiteConverter.from_keras_model(model)
          converter.optimizations = [tf.lite.Optimize.DEFAULT]
          converter.representative_dataset = representative_data_gen
          converter.target_spec.supported_ops = [
              tf.lite.OpsSet.TFLITE_BUILTINS_INT8
          ]
          converter.inference_input_type = tf.uint8
          converter.inference_output_type = tf.uint8
          tflite_model_quant = converter.convert()
      else:
          converter = tf.lite.TFLiteConverter.from_keras_model(model)
          converter.optimizations = [tf.lite.Optimize.DEFAULT]
          tflite_model_quant = converter.convert()
  
      interpreter = tf.lite.Interpreter(
          model_content=tflite_model_quant
      )
      interpreter.allocate_tensors()
      test_accuracy = _evaluate_model(interpreter, x_test, y_test)
  
      return test_accuracy
  
imports: import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.clustering.keras import cluster
  from tensorflow_model_optimization.python.core.clustering.keras import cluster_config
  from tensorflow_model_optimization.python.core.clustering.keras.experimental import cluster
  from tensorflow_model_optimization.python.core.quantization.keras import quantize
  from tensorflow_model_optimization.python.core.quantization.keras.collab_opts.cluster_preserve import cluster_utils
  from tensorflow_model_optimization.python.core.quantization.keras.collab_opts.cluster_preserve import default_8bit_cluster_preserve_quantize_scheme
  from tensorflow_model_optimization.python.core.sparsity.keras import prune
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_callbacks
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_schedule
label_desc: Use image node_id 12 for calling a global function with example usage: _check_tflite_conversion(model, integer_only_quant) and returns: test_accuracy