code: def apply_speedup(self, dummy_input, mask_path=None, *args, **kwargs):
      if (
          self._compression_framework != "torch"
          or self._compression_type != "pruning"
      ):
          raise ValueError(
              "Can only apply_speedup for PyTorch pruning compressions."
          )
  
      # Ideally, inference model would be re-created here, but _unwrap_model() seems to work as well
      self._nni_compressor._unwrap_model()
  
      try:
          # Normally, the model would be exported first and its masks file used for speedup ("else" case)
          # But here ("if"), the mask_dictionary object is constructed on-demand in-memory without saving to disk
          if mask_path is None:
              mask_dict = self._nni_compressor.get_mask_dict()
              m_speedup = ModelSpeedup(
                  self.model, dummy_input, masks=mask_dict
              )
          else:
              m_speedup = ModelSpeedup(
                  self.model, dummy_input, masks_file=mask_path
              )
          m_speedup.speedup_model()
      except Exception as ex:
          self._nni_compressor._wrap_model()
          raise ValueError("Error encountered in apply_speedup.")
  
      self._applied_speedup = True
  
      return self.model
  
file_path: auptimizer/src/aup/compression/Compressor.py
imports: import copy
  import logging
  import os
  from ..utils import check_missing_key
label_desc: Use image node_id 7 for calling the Compressor obj's underlying member method code with example usage: obj.apply_speedup(dummy_input, mask_path) and returns: self