code: def test_nm_pruner_polynomial_scheduler():
      model = torch.nn.Linear(8, 2)
      weights = torch.tensor(
          [[2, 3, 7, 4, 5, 8, 1, 6], [4, 5, 1, 6, 2, 3, 7, 8]],
          dtype=torch.float,
      )
      model.weight.data = weights
      data = torch.randn(1, 8)
  
      config = MagnitudePrunerConfig.from_dict(
          {
              "global_config": {
                  "scheduler": {"update_steps": range(8), "power": 1},
                  "n_m_ratio": (7, 8),
              }
          }
      )
      pruner = MagnitudePruner(model, config)
      model = pruner.prepare()
  
      for idx in range(7):
          pruner.step()
          model(data)
          for row in range(2):
              assert torch.count_nonzero(model.weight_mask[row]) == (
                  7 - idx
              )
  
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 23 for calling a global function with example usage: test_nm_pruner_polynomial_scheduler() without return types