docstr: Check that we prune supported layers with m by n sparsity.
docstr_tok: ["Check","that","we","prune","supported","layers","with","m","by","n","sparsity","."]
code: def testMbyNSparsityPruning_SupportedLayers(
      self,
      layer_type,
      layer_arg,
      input_shape,
      m_by_n=(2, 4),
      sparsity_ratio=0.50,
  ):
      """Check that we prune supported layers with m by n sparsity."""
      self.params.update({"sparsity_m_by_n": m_by_n})
  
      model = keras.Sequential()
      model.add(
          prune.prune_low_magnitude(
              layer_type(*layer_arg),
              input_shape=input_shape,
              **self.params,
          )
      )
      model.compile(
          loss="categorical_crossentropy",
          optimizer="sgd",
          metrics=["accuracy"],
      )
  
      test_utils.assert_model_sparsity(self, 0.0, model)
      model.fit(
          np.random.randn(
              *self._batch(model.input.get_shape().as_list(), 32)
          ),
          np.random.randn(
              *self._batch(model.output.get_shape().as_list(), 32)
          ),
          callbacks=[pruning_callbacks.UpdatePruningStep()],
      )
  
      test_utils.assert_model_sparsity_m_by_n(self, model, m_by_n)
      self._check_strip_pruning_matches_original(model, sparsity_ratio)
  
imports: import tempfile
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.keras import test_utils
  from tensorflow_model_optimization.python.core.sparsity.keras import prune
  from tensorflow_model_optimization.python.core.sparsity.keras import prune_registry
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_callbacks
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_schedule
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_wrapper
  from tensorflow_model_optimization.python.core.sparsity.keras import test_utils
label_desc: Use image node_id 18 for calling the PruneIntegrationTest obj's underlying member method code with example usage: obj.testMbyNSparsityPruning_SupportedLayers(layer_type, layer_arg, input_shape, m_by_n, sparsity_ratio) without return types