code: def main(unused_argv):
      # input image dimensions
      img_rows, img_cols = 28, 28
  
      # the data, shuffled and split between train and test sets
      (x_train, y_train), (
          x_test,
          y_test,
      ) = tf.keras.datasets.mnist.load_data()
  
      if tf.keras.backend.image_data_format() == "channels_first":
          x_train = x_train.reshape(
              x_train.shape[0], 1, img_rows, img_cols
          )
          x_test = x_test.reshape(
              x_test.shape[0], 1, img_rows, img_cols
          )
          input_shape = (1, img_rows, img_cols)
      else:
          x_train = x_train.reshape(
              x_train.shape[0], img_rows, img_cols, 1
          )
          x_test = x_test.reshape(
              x_test.shape[0], img_rows, img_cols, 1
          )
          input_shape = (img_rows, img_cols, 1)
  
      x_train = x_train.astype("float32")
      x_test = x_test.astype("float32")
      x_train /= 255
      x_test /= 255
      print("x_train shape:", x_train.shape)
      print(x_train.shape[0], "train samples")
      print(x_test.shape[0], "test samples")
  
      # convert class vectors to binary class matrices
      y_train = tf.keras.utils.to_categorical(y_train, num_classes)
      y_test = tf.keras.utils.to_categorical(y_test, num_classes)
  
      pruning_params = {
          "pruning_schedule": PolynomialDecay(
              initial_sparsity=0.1,
              final_sparsity=0.75,
              begin_step=1000,
              end_step=5000,
              frequency=100,
          )
      }
  
      layerwise_model = build_layerwise_model(
          input_shape, **pruning_params
      )
      sequential_model = build_sequential_model(input_shape)
      sequential_model = prune.prune_low_magnitude(
          sequential_model, **pruning_params
      )
      functional_model = build_functional_model(input_shape)
      functional_model = prune.prune_low_magnitude(
          functional_model, **pruning_params
      )
  
      models = [layerwise_model, sequential_model, functional_model]
      train_and_save(models, x_train, y_train, x_test, y_test)
  
file_path: model-optimization/tensorflow_model_optimization/python/examples/sparsity/keras/mnist/mnist_cnn.py
imports: from __future__ import print_function
  from absl import app
  from absl import flags
  import tensorflow
  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 5 for calling a global function with example usage: main(unused_argv) without return types