def METHOD_NAME(sparsity, model):
  for layer in model.layers:
    if isinstance(layer, pruning_wrapper.PruneLowMagnitude):
      for weight in layer.layer.get_prunable_weights():
        if sparsity != _get_sparsity(tf.keras.backend.get_value(weight)):
          return True
  return False