code: def generate_pruners(config, model):
      """Generate pruners.
      Args:
          config (`neural_compressor.WeightPruningConfig`)
              The object to the class WeightPruningConfig.
          model (`torch.nn.module`)
              The torch module object to be pruned.
      """
      assert (
          nc_pruner is not None
      ), "please ensure the neural_compressor python package is installed by pip or conda if user wants to use snip_momentum sparse pruning"
      from nc_pruner.utils import process_config, parse_to_prune
      from nc_pruner.pruners import get_pruner
  
      assert isinstance(model, torch.nn.Module)
      pruners_info = process_config(config)
      pruners = []
      for info in pruners_info:
          modules = parse_to_prune(info, model)
          if modules == {}:
              logger.warning(
                  "one pruner hooks no layers, please have a check"
              )
  
          pruners.append(get_pruner(info, modules))
          info["modules"] = [key for key in modules.keys()]
          info["len_of_modules"] = len(info["modules"])
          logger.info(info)
      return pruners
  
file_path: DeepSpeed/deepspeed/compression/helper.py
imports: import torch
  from .basic_layer import Embedding_Compress, LinearLayer_Compress, Conv2dLayer_Compress, BNLayer_Compress, ColumnParallelLinear_Compress, RowParallelLinear_Compress
  from .constants import *
  from deepspeed.utils import logger
label_desc: Use image node_id 8 for calling a global function with example usage: generate_pruners(config, model) and returns: pruners