class_docstr: Abstract base PyTorch compressor
docstr: Find the configuration for `layer` by parsing `self.config_list`
  
  Parameters
  ----------
  layer : LayerInfo
      one layer
  
  Returns
  -------
  config or None
      the retrieved configuration for this layer, if None, this layer should
      not be compressed
docstr_tok: ["Find","the","configuration","for","`","layer","`","by","parsing","`","self.config_list","`","Parameters","--","--","--","--","--","layer",":","LayerInfo","one","layer","Returns","--","--","--","-","config","or","None","the","retrieved","configuration","for","this","layer",",","if","None",",","this","layer","should","not","be","compressed"]
code: def select_config(self, layer):
      """
      Find the configuration for `layer` by parsing `self.config_list`
  
      Parameters
      ----------
      layer : LayerInfo
          one layer
  
      Returns
      -------
      config or None
          the retrieved configuration for this layer, if None, this layer should
          not be compressed
      """
      ret = None
      for config in self.config_list:
          config = config.copy()
          # expand config if key `default` is in config['op_types']
          if "op_types" in config and "default" in config["op_types"]:
              expanded_op_types = []
              for op_type in config["op_types"]:
                  if op_type == "default":
                      expanded_op_types.extend(
                          default_layers.weighted_modules
                      )
                  else:
                      expanded_op_types.append(op_type)
              config["op_types"] = expanded_op_types
  
          # check if condition is satisified
          if (
              "op_types" in config
              and layer.type not in config["op_types"]
          ):
              continue
          if (
              "op_names" in config
              and layer.name not in config["op_names"]
          ):
              continue
  
          ret = config
      if ret is None or "exclude" in ret:
          return None
      return ret
  
imports: import types
  import logging
  import torch
  from .None import default_layers
label_desc: Use image node_id 11 for calling the Compressor obj's underlying member method code with example usage: obj.select_config(layer) and returns: ret, None