class_docstr: Abstract base PyTorch compressor
docstr: detect all modules should be compressed, and save the result in `self.modules_to_compress`.
  The model will be instrumented and user should never edit it after calling this method.
docstr_tok: ["detect","all","modules","should","be","compressed",",","and","save","the","result","in","`","self.modules_to_compress","`",".","The","model","will","be","instrumented","and","user","should","never","edit","it","after","calling","this","method","."]
code: def _detect_modules_to_compress(self):
      """
      detect all modules should be compressed, and save the result in `self.modules_to_compress`.
      The model will be instrumented and user should never edit it after calling this method.
      """
      if self.modules_to_compress is None:
          self.modules_to_compress = []
          for name, module in self.bound_model.named_modules():
              if module == self.bound_model:
                  continue
              layer = LayerInfo(name, module)
              config = self.select_config(layer)
              if config is not None:
                  self.modules_to_compress.append((layer, config))
      return self.modules_to_compress
  
imports: import types
  import logging
  import torch
  from .None import default_layers
label_desc: Use image node_id 4 for calling the Compressor obj's underlying member method code with example usage: obj._detect_modules_to_compress() and returns: self