class_docstr: Specifies to prune only 1x1 Conv2D layers in the model.
  
  PruneForLatencyOnXNNPack checks that the model contains a subgraph that can
  leverage XNNPACK's sparse inference and applies pruning wrapper only to
  Conv2D with `kernel_size = (1, 1)`.
  
  Reference:
    - [Fast Sparse ConvNets](https://arxiv.org/abs/1911.09723)
    - [XNNPACK Sparse Inference](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/delegates/xnnpack/README.md#sparse-inference) # pylint: disable=line-too-long
class_docstr_tok: ["Specifies","to","prune","only","1x1","Conv2D","layers","in","the","model",".","PruneForLatencyOnXNNPack","checks","that","the","model","contains","a","subgraph","that","can","leverage","XNNPACK","'s","sparse","inference","and","applies","pruning","wrapper","only","to","Conv2D","with","`","kernel_size","=","(","1",",","1",")","`",".","Reference",":","-","[","Fast","Sparse","ConvNets","]","(","https",":","\/\/arxiv.org\/abs\/1911.09723",")","-","[","XNNPACK","Sparse","Inference","]","(","https",":","\/\/github.com\/tensorflow\/tensorflow\/blob\/master\/tensorflow\/lite\/delegates\/xnnpack\/README.md","#","sparse-inference",")","#","pylint",":","disable=line-too-long"]
docstr: Determines whether the layer starts a subgraph of sparse inference.
docstr_tok: ["Determines","whether","the","layer","starts","a","subgraph","of","sparse","inference","."]
code: def _start_layer_stop_fn(self, layer):
      """Determines whether the layer starts a subgraph of sparse inference."""
      if isinstance(layer, layers.Conv2D):
          producers = list(self._get_producers(layer))
          return (
              hasattr(layer, "kernel")
              and layer.kernel.shape[:3] == (3, 3, 3)
              and layer.strides == (2, 2)
              and layer.padding.lower() == "valid"
              and len(producers) == 1
              and isinstance(producers[0], layers.ZeroPadding2D)
              and producers[0].padding == ((1, 1), (1, 1))
          )
      return False
  
file_path: model-optimization/tensorflow_model_optimization/python/core/sparsity/keras/pruning_policy.py
imports: import abc
  import tensorflow
  from tensorflow_model_optimization.python.core.quantization.keras import utils
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_wrapper
label_desc: Use image node_id 5 for calling the PruneForLatencyOnXNNPack obj's underlying member method code with example usage: obj._start_layer_stop_fn(layer) and returns: False, unknown