class_docstr: _StructuredFilterPruner has two ways to calculate the masks
  for conv layers. In the normal way, the _StructuredFilterPruner
  will calculate the mask of each layer separately. For example, each
  conv layer determine which filters should be pruned according to its L1
  norm. In constrast, in the dependency-aware way, the layers that in a
  dependency group will be pruned jointly and these layers will be forced
  to prune the same channels.
class_docstr_tok: ["_StructuredFilterPruner","has","two","ways","to","calculate","the","masks","for","conv","layers",".","In","the","normal","way",",","the","_StructuredFilterPruner","will","calculate","the","mask","of","each","layer","separately",".","For","example",",","each","conv","layer","determine","which","filters","should","be","pruned","according","to","its","L1","norm",".","In","constrast",",","in","the","dependency-aware","way",",","the","layers","that","in","a","dependency","group","will","be","pruned","jointly","and","these","layers","will","be","forced","to","prune","the","same","channels","."]
docstr: In the original update_mask, the wraper of each layer will update its
  own mask according to the sparsity specified in the config_list. However, in
  the _dependency_update_mask, we may prune several layers at the same
  time according the sparsities and the channel/group dependencies.
code: def _dependency_update_mask(self):
      """
      In the original update_mask, the wraper of each layer will update its
      own mask according to the sparsity specified in the config_list. However, in
      the _dependency_update_mask, we may prune several layers at the same
      time according the sparsities and the channel/group dependencies.
      """
      name2wrapper = {x.name: x for x in self.get_modules_wrapper()}
      wrapper2index = {
          x: i for i, x in enumerate(self.get_modules_wrapper())
      }
      for wrapper in self.get_modules_wrapper():
          if wrapper.if_calculated:
              continue
          # find all the conv layers that have channel dependecy with this layer
          # and prune all these layers at the same time.
          _names = [x for x in self.channel_depen[wrapper.name]]
          logger.info(
              "Pruning the dependent layers: %s", ",".join(_names)
          )
          _wrappers = [
              name2wrapper[name]
              for name in _names
              if name in name2wrapper
          ]
          _wrapper_idxes = [wrapper2index[_w] for _w in _wrappers]
  
          masks = self._dependency_calc_mask(
              _wrappers, _names, wrappers_idx=_wrapper_idxes
          )
          if masks is not None:
              for layer in masks:
                  for mask_type in masks[layer]:
                      assert hasattr(name2wrapper[layer], mask_type), (
                          "there is no attribute '%s' in wrapper on %s"
                          % (mask_type, layer)
                      )
                      setattr(
                          name2wrapper[layer],
                          mask_type,
                          masks[layer][mask_type],
                      )
  
imports: import logging
  from schema import And, Optional, SchemaError
  from .._graph_utils import TorchModuleGraph
  from ..utils.shape_dependency import ChannelDependency, GroupDependency
  from .constants import MASKER_DICT
  from ..utils.config_validation import CompressorSchema
  from ..compressor import Pruner
label_desc: Use image node_id 5 for calling the _StructuredFilterPruner obj's underlying member method code with example usage: obj._dependency_update_mask() without return types