code: def main(unused_args):
      # Load the MNIST dataset.
      mnist = tf.keras.datasets.mnist
      (train_images, train_labels), (
          test_images,
          test_labels,
      ) = mnist.load_data()
      # data preprocessing
      # normalize the input images so that each pixel value is between 0 and 1.
      train_images = train_images / 255.0
      test_images = test_images / 255.0
      train_images = tf.expand_dims(train_images, axis=-1)
      test_images = tf.expand_dims(test_images, axis=-1)
      input_shape = train_images.shape[1:]
      print("train_images shape:", train_images.shape)
      print(train_images.shape[0], "train samples")
      print(test_images.shape[0], "test samples")
  
      model = build_sequential_model(input_shape)
  
      pruned_model = prune_model(model, train_images, train_labels)
      evaluate_and_show_sparsity(pruned_model, test_images, test_labels)
  
      pqat_model = prune_preserve_quantize_model(
          pruned_model, train_images, train_labels
      )
      evaluate_and_show_sparsity(pqat_model, test_images, test_labels)
  
file_path: model-optimization/tensorflow_model_optimization/python/examples/quantization_with_sparsity/keras/mnist_cnn.py
imports: from __future__ import print_function
  from absl import app
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.quantization.keras import quantize
  from tensorflow_model_optimization.python.core.quantization.keras.collab_opts.prune_preserve import default_8bit_prune_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 6 for calling a global function with example usage: main(unused_args) without return types