class_docstr: Common base class for all compressors.
  
  This class is designed for other base classes.
  Algorithms should inherit ``Pruner`` or ``Quantizer`` instead.
  
  Attributes
  ----------
  compressed_model : tf.keras.Model
      Compressed user model.
  wrappers : list of tf.keras.Model
      A wrapper is an instrumented TF ``Layer``, in ``Model`` format.
  
  Parameters
  ----------
  model : tf.keras.Model
      The user model to be compressed.
  config_list : list of JSON object
      User configuration. The format is detailed in tutorial.
  LayerWrapperClass : a class derive from Model
      The class used to instrument layers.
class_docstr_tok: ["Common","base","class","for","all","compressors",".","This","class","is","designed","for","other","base","classes",".","Algorithms","should","inherit","``","Pruner","``","or","``","Quantizer","``","instead",".","Attributes","--","--","--","--","--","compressed_model",":","tf.keras.Model","Compressed","user","model",".","wrappers",":","list","of","tf.keras.Model","A","wrapper","is","an","instrumented","TF","``","Layer","``",",","in","``","Model","``","format",".","Parameters","--","--","--","--","--","model",":","tf.keras.Model","The","user","model","to","be","compressed",".","config_list",":","list","of","JSON","object","User","configuration",".","The","format","is","detailed","in","tutorial",".","LayerWrapperClass",":","a","class","derive","from","Model","The","class","used","to","instrument","layers","."]
code: def _select_config(self, layer):
      # Find the last matching config block for given layer.
      # Returns None if the layer should not be compressed.
      layer_type = type(layer).__name__
      last_match = None
      for config in self._config_list:
          if "op_types" in config:
              match = layer_type in config["op_types"]
              match_default = (
                  "default" in config["op_types"]
                  and layer_type in default_layers.weighted_modules
              )
              if not match and not match_default:
                  continue
          if (
              "op_names" in config
              and layer.name not in config["op_names"]
          ):
              continue
          last_match = config
      if last_match is None or "exclude" in last_match:
          return None
      return last_match
  
file_path: auptimizer/src/aup/compression/tensorflow/compressor.py
imports: import logging
  from .None import default_layers
label_desc: Use image node_id 7 for calling the Compressor obj's underlying member method code with example usage: obj._select_config(layer) and returns: last_match, None