class_docstr: A Keras callback for adding pruning summaries to tensorboard.
  
  Logs the sparsity(%) and threshold at a given iteration step.
class_docstr_tok: ["A","Keras","callback","for","adding","pruning","summaries","to","tensorboard",".","Logs","the","sparsity","(","%",")","and","threshold","at","a","given","iteration","step","."]
code: def __init__(self, log_dir, update_freq="epoch", **kwargs):
      if not isinstance(log_dir, six.string_types) or not log_dir:
          raise ValueError(
              "`log_dir` must be a non-empty string. You passed `log_dir`="
              "{input}.".format(input=log_dir)
          )
  
      super(PruningSummaries, self).__init__(
          log_dir=log_dir, update_freq=update_freq, **kwargs
      )
      if not compat.is_v1_apis():  # TF 2.X
          log_dir = self.log_dir + "/metrics"
          self._file_writer = tf.summary.create_file_writer(log_dir)
  
file_path: model-optimization/tensorflow_model_optimization/python/core/sparsity/keras/pruning_callbacks.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import six
  import tensorflow
  from tensorflow_model_optimization.python.core.keras import compat
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_wrapper
label_desc: Use image node_id 1 to create a new PruningSummaries object from inherited base classes: callbacks with example: obj = PruningSummaries(log_dir, update_freq)