code: def _build_mnist_layerwise_pruned_model(pruning_params):
      if pruning_params is None:
          raise ValueError("pruning_params should be provided.")
  
      return keras.Sequential(
          [
              prune.prune_low_magnitude(
                  l.Conv2D(32, 5, padding="same", activation="relu"),
                  input_shape=(28, 28, 1),
                  **pruning_params,
              ),
              l.MaxPooling2D((2, 2), (2, 2), padding="same"),
              l.BatchNormalization(),
              prune.prune_low_magnitude(
                  l.Conv2D(64, 5, padding="same", activation="relu"),
                  **pruning_params,
              ),
              l.MaxPooling2D((2, 2), (2, 2), padding="same"),
              l.Flatten(),
              prune.prune_low_magnitude(
                  l.Dense(1024, activation="relu"), **pruning_params
              ),
              l.Dropout(0.4),
              prune.prune_low_magnitude(
                  l.Dense(10, activation="softmax"), **pruning_params
              ),
          ]
      )
  
file_path: model-optimization/tensorflow_model_optimization/python/core/sparsity/keras/test_utils.py
imports: import tempfile
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.sparsity.keras import prune
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_utils
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_wrapper
label_desc: Use image node_id 4 for calling a global function with example usage: _build_mnist_layerwise_pruned_model(pruning_params) and returns: keras