class_docstr: This is replacer is used to replace the leaf-module in the model.
  Leaf-module is the ``torch.nn.Module`` that contains no ``torch.nn.Module`` as its attribute.
  
  Parameters
  ----------
  replace_module_func_dict
      A dict of module compression function, {module_type_name: replace_func}.
      The input of replace_func is the original module and its masks, the output is the compressed module,
      (original_module, (input_mask, output_mask, weight_mask)) -> compressed_module.
  
      Here is an exmaple for module type name ``FakeModule`` replace function::
  
          def fake_module_replace(ori_module, masks):
              in_mask, out_mask, weight_mask = masks
              # prune the ori_module to a new smaller module according to the mask
              return new_small_module
  
          replace_module_func_dict = {'FakeModule': fake_module_replace}
code: def __init__(self, replace_module_func_dict: Dict[str, Callable]):
      self.replace_module_func_dict = replace_module_func_dict
  
file_path: nni/nni/compression/speedup/replacer.py
imports: import logging
  from typing import TYPE_CHECKING, Callable, Dict
  from torch.utils._pytree import tree_map
  from ..utils import get_nested_attr, set_nested_attr
label_desc: Use image node_id 1 to create a new DefaultReplacer object from inherited base classes: Replacer with example: obj = DefaultReplacer(replace_module_func_dict)