code: def testConditionalMaskUpdate(self):
      weight = tf.Variable(np.linspace(1.0, 100.0, 100), name="weights")
      weight_dtype = weight.dtype.base_dtype
      mask = tf.Variable(
          tf.ones(weight.get_shape(), dtype=weight_dtype),
          name="mask",
          dtype=weight_dtype,
      )
      threshold = tf.Variable(
          tf.zeros([], dtype=weight_dtype),
          name="threshold",
          dtype=weight_dtype,
      )
      self.initialize()
  
      def linear_sparsity(step):
          sparsity_val = tf.convert_to_tensor(
              [0.0, 0.1, 0.1, 0.3, 0.3, 0.5, 0.5, 0.5, 0.5, 0.5]
          )
          return tf.convert_to_tensor(True), sparsity_val[step]
  
      # Set up pruning
      p = pruning_impl.Pruning(
          pruning_vars=[(weight, mask, threshold)],
          training_step_fn=self.training_step_fn,
          pruning_schedule=linear_sparsity,
          block_size=self.block_size,
          block_pooling_type=self.block_pooling_type,
      )
  
      non_zero_count = []
      for _ in range(10):
          if tf.executing_eagerly():
              p.conditional_mask_update()
              p.weight_mask_op()
              assign_add(self.global_step, 1)
          else:
              K.get_session().run(p.conditional_mask_update())
              K.get_session().run(p.weight_mask_op())
              K.get_session().run(assign_add(self.global_step, 1))
  
          non_zero_count.append(np.count_nonzero(K.get_value(weight)))
  
      # Weights pruned at steps 1,3,5
      expected_non_zero_count = [
          100,
          90,
          90,
          70,
          70,
          50,
          50,
          50,
          50,
          50,
      ]
      self.assertAllEqual(expected_non_zero_count, non_zero_count)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.keras import compat
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_impl
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_schedule
label_desc: Use image node_id 10 for calling the PruningTest obj's underlying member method code with example usage: obj.testConditionalMaskUpdate() and returns: tf,  sparsity_val