code: def test_sparsity_report_block2_sparsity_not_applicable():
      model = torch.nn.Sequential(
          torch.nn.Conv2d(1, 31, 2, 1), torch.nn.Conv2d(31, 21, 2, 1)
      )
      target_sparsity = 0.5
      config = MagnitudePrunerConfig.from_dict(
          {
              "global_config": {
                  "scheduler": {"begin_step": 0},
                  "initial_sparsity": 0.0,
                  "target_sparsity": target_sparsity,
              }
          },
      )
      pruner = MagnitudePruner(model, config)
      pruner.prepare(inplace=True)
  
      inp = torch.ones(1, 1, 28, 28)
      for _ in range(2):
          pruner.step()
          model(inp)
  
      report = pruner.report()
  
      assert len(report) == 3
  
      for sparsity in [
          val["block2_weight_sparsity"] for _, val in report.items()
      ]:
          assert sparsity == -1
  
imports: import copy
  from collections import OrderedDict
  import numpy
  import pytest
  import torch
  from coremltools.optimize.torch.pruning import MagnitudePruner, MagnitudePrunerConfig, ModuleMagnitudePrunerConfig
  from coremltools.optimize.torch.pruning._utils import n_m_mask
label_desc: Use image node_id 19 for calling a global function with example usage: test_sparsity_report_block2_sparsity_not_applicable() without return types