code: def _log_sparsified_level(model, data_sparsifier) -> None:
      # Show the level of sparsity AFTER step:
      for name, parameter in model.named_parameters():
          if type(parameter) not in SUPPORTED_TYPES:
              continue
          valid_name = _get_valid_name(name)
          mask = data_sparsifier.get_mask(name=valid_name)
          sparsity_level = 1.0 - mask.float().mean()
          logger.info(
              "Sparsity in layer %s = % .2%", name, sparsity_level
          )
  
imports: import logging
  from torch.ao.pruning._experimental.data_sparsifier.base_data_sparsifier import SUPPORTED_TYPES
label_desc: Use image node_id 3 for calling a global function with example usage: _log_sparsified_level(model, data_sparsifier) without return types