class_docstr: Pruning Schedule with a PolynomialDecay function.
class_docstr_tok: ["Pruning","Schedule","with","a","PolynomialDecay","function","."]
code: def __call__(self, step):
      # TODO(tf-mot): consider switch to divide for 1.XX also.
      if hasattr(tf, "div"):
          divide = tf.div
      else:
          divide = tf.math.divide
  
      # TODO(pulkitb): Replace function with tf.polynomial_decay
      with tf.name_scope("polynomial_decay_pruning_schedule"):
          p = tf.math.minimum(
              1.0,
              tf.math.maximum(
                  0.0,
                  divide(
                      tf.dtypes.cast(
                          step - self.begin_step, tf.float32
                      ),
                      self.end_step - self.begin_step,
                  ),
              ),
          )
          sparsity = tf.math.add(
              tf.math.multiply(
                  self.initial_sparsity - self.final_sparsity,
                  tf.math.pow(1 - p, self.power),
              ),
              self.final_sparsity,
              name="sparsity",
          )
  
      return (
          self._should_prune_in_step(
              step, self.begin_step, self.end_step, self.frequency
          ),
          sparsity,
      )
  
imports: import abc
  import six
  import tensorflow
label_desc: Use image node_id 2 for calling the PolynomialDecay obj's underlying member method code with example usage: obj.__call__(step) and returns: self,  sparsity