class_docstr: This class is to speedup the model with provided weight mask
docstr: There are basically two steps:
  first, do mask/shape inference,
  second, replace modules
code: def speedup_model(self):
      """
      There are basically two steps:
      first, do mask/shape inference,
      second, replace modules
      """
      training = self.bound_model.training
      _logger.info("start to speed up the model")
  
      _logger.info("fix the mask conflict of the interdependent layers")
      _, conv_prune_dim = fix_mask_conflict(
          self.masks, self.bound_model, self.dummy_input
      )
      set_conv_prune_dim(conv_prune_dim)
  
      _logger.info("infer module masks...")
      self.infer_modules_masks()
      _logger.info("replace compressed modules...")
      self.replace_compressed_modules()
      self.bound_model.train(training)
      _logger.info("speedup done")
  
file_path: auptimizer/src/aup/compression/torch/speedup/compressor.py
imports: import logging
  import torch
  from ..utils.mask_conflict import fix_mask_conflict
  from ..utils.utils import get_module_by_name
  from .compress_modules import replace_module
  from .infer_shape import ModuleMasks, infer_from_mask, infer_from_inshape, infer_from_outshape, set_conv_prune_dim
label_desc: Use image node_id 5 for calling the ModelSpeedup obj's underlying member method code with example usage: obj.speedup_model() without return types