class_docstr: An abstraction for implementing schedules to be used for
  changing the sparsity of pruning masks applied by various types of
  pruning algorithms to module parameters over the course of the training.
class_docstr_tok: ["An","abstraction","for","implementing","schedules","to","be","used","for","changing","the","sparsity","of","pruning","masks","applied","by","various","types","of","pruning","algorithms","to","module","parameters","over","the","course","of","the","training","."]
docstr: Compute the sparsity at the next step given the previous sparsity
  and the module optimization config.
  
  Args:
      step_count (:obj:`int`): Current step count.
      prev_sparsity (:obj:`float`): Sparsity at previous step.
      config (:py:class:`ModuleOptimizationConfig`): Optimization
          config for the module which contains information such as
          target sparsity and initial sparsity.
docstr_tok: ["Compute","the","sparsity","at","the","next","step","given","the","previous","sparsity","and","the","module","optimization","config",".","Args",":","step_count","(",":","obj",":","`","int","`",")",":","Current","step","count",".","prev_sparsity","(",":","obj",":","`","float","`",")",":","Sparsity","at","previous","step",".","config","(",":","py",":","class",":","`","ModuleOptimizationConfig","`",")",":","Optimization","config","for","the","module","which","contains","information","such","as","target","sparsity","and","initial","sparsity","."]
code: def compute_sparsity(
      self,
      step_count: int,
      prev_sparsity: float,
      config: _ModuleOptimizationConfig,
  ) -> float:
      """
      Compute the sparsity at the next step given the previous sparsity
      and the module optimization config.
  
      Args:
          step_count (:obj:`int`): Current step count.
          prev_sparsity (:obj:`float`): Sparsity at previous step.
          config (:py:class:`ModuleOptimizationConfig`): Optimization
              config for the module which contains information such as
              target sparsity and initial sparsity.
      """
      raise NotImplementedError()
  
imports: from abc import ABC
  from abc import abstractmethod
  from typing import Union
  import attr
  import torch
  from attr import define
  from attr import field
  from attrs import validators
  from coremltools.optimize.torch._utils.torch_utils import list_or_str_to_tensor
  from coremltools.optimize.torch.optimization_config import ModuleOptimizationConfig
  from coremltools.optimize.torch.pruning._utils import spline
label_desc: Use image node_id 1 for calling the PruningScheduler obj's underlying member method code with example usage: obj.compute_sparsity(step_count, prev_sparsity, config) without return types