docstr: Inherited from the compressor exsited wrappers and evaluator to initialize a new compressor.
  
  Parameters
  ----------
  compressor
      The bound model, wrappers and evaluator in this compressor will be inherited to create a new compressor.
  new_config_list
      The config_list used to config the new compressor.
  evaluator
      Key-word only parameter. If the inherited compressor doesn't have an evaluator, then this evaluator will be used to
      initialize the new compressor. If the inherited compressor already has an evaluator, this parameter will be ignored.
  args
      Positional arguments. Will be directly passed to the ``__init__`` function.
  kwargs
      Keyword arguments. Will be directly passed to the ``__init__`` function.
docstr_tok: ["Inherited","from","the","compressor","exsited","wrappers","and","evaluator","to","initialize","a","new","compressor",".","Parameters","--","--","--","--","--","compressor","The","bound","model",",","wrappers","and","evaluator","in","this","compressor","will","be","inherited","to","create","a","new","compressor",".","new_config_list","The","config_list","used","to","config","the","new","compressor",".","evaluator","Key-word","only","parameter",".","If","the","inherited","compressor","does","n't","have","an","evaluator",",","then","this","evaluator","will","be","used","to","initialize","the","new","compressor",".","If","the","inherited","compressor","already","has","an","evaluator",",","this","parameter","will","be","ignored",".","args","Positional","arguments",".","Will","be","directly","passed","to","the","``","__init__","``","function",".","kwargs","Keyword","arguments",".","Will","be","directly","passed","to","the","``","__init__","``","function","."]
code: def from_compressor(
      cls,
      compressor: Compressor,
      new_config_list: List[Dict],
      *args,
      evaluator: Evaluator | None = None,
      **kwargs,
  ):
      """
      Inherited from the compressor exsited wrappers and evaluator to initialize a new compressor.
  
      Parameters
      ----------
      compressor
          The bound model, wrappers and evaluator in this compressor will be inherited to create a new compressor.
      new_config_list
          The config_list used to config the new compressor.
      evaluator
          Key-word only parameter. If the inherited compressor doesn't have an evaluator, then this evaluator will be used to
          initialize the new compressor. If the inherited compressor already has an evaluator, this parameter will be ignored.
      args
          Positional arguments. Will be directly passed to the ``__init__`` function.
      kwargs
          Keyword arguments. Will be directly passed to the ``__init__`` function.
      """
      if compressor._is_wrapped:
          compressor.unwrap_model()
      model = compressor.bound_model
      existed_wrappers = compressor._module_wrappers
      if compressor.evaluator is not None and evaluator is not None:
          _logger.warning(
              "compessor already has evaluator, the new evaluator passed to this function will be ignored."
          )
      evaluator = (
          compressor.evaluator if compressor.evaluator else evaluator
      )
  
      new_compressor = cls(
          model=model,
          config_list=new_config_list,
          evaluator=evaluator,
          existed_wrappers=existed_wrappers,
          *args,
          **kwargs,
      )
      new_compressor.fused_compressors.extend(
          compressor.fused_compressors
      )
      return new_compressor
  
imports: from __future__ import annotations
  from collections import defaultdict
  from copy import deepcopy
  import logging
  from typing import Any, Dict, List, Literal, Callable
  import torch
  from torch.utils._pytree import tree_map
  from .config import trans_legacy_config_list, default_config_schema
  from .target_space import TargetSpace, TargetType, DistillationTargetSpace, PruningTargetSpace, QuantizationTargetSpace
  from .wrapper import ModuleWrapper, register_wrappers
  from ..utils import Evaluator, Scaling, _EVALUATOR_DOCSTRING
label_desc: Use image node_id 2 for calling the Compressor obj's underlying member method code with example usage: obj.from_compressor(cls, compressor, new_config_list) and returns: new_compressor