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 _log_pruning_metrics(self, logs, prefix, step):
      if compat.is_v1_apis():
          # Safely depend on TF 1.X private API given
          # no more 1.X releases.
          self._write_custom_summaries(step, logs)
      else:
          with self._file_writer.as_default():
              for name, value in logs.items():
                  tf.summary.scalar(name, value, step=step)
  
              self._file_writer.flush()
  
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 2 for calling the PruningSummaries obj's underlying member method code with example usage: obj._log_pruning_metrics(logs, prefix, step) without return types