code: def prune_trained_model(cls, model, optimizer):
      # add mask buffers to model (init_model_for_pruning), augment optimizer (init_optimizer_for_pruning) and compute masks (compute_sparse_masks)
      cls.init_model_for_pruning(
          model,
          mask_calculator="m4n2_1d",
          verbosity=2,
          whitelist=[
              torch.nn.Linear,
              torch.nn.Conv2d,
              torch.nn.MultiheadAttention,
          ],
          allow_recompute_mask=False,
      )
      cls.init_optimizer_for_pruning(optimizer)
      cls.compute_sparse_masks()
  
file_path: apex/apex/contrib/sparsity/asp.py
imports: import types
  import torch
  from .sparse_masklib import create_mask
  from .permutation_lib import Permutation
  import json
  import os
  import string
  import time
label_desc: Use image node_id 7 for calling the ASP obj's underlying member method code with example usage: obj.prune_trained_model(cls, model, optimizer) without return types