class_docstr: Saves data in event and summary protos for tensorboard.
class_docstr_tok: ["Saves","data","in","event","and","summary","protos","for","tensorboard","."]
docstr: Saves histogram of values.
  
  Args:
    tag: str: label for this data
    values: ndarray: will be flattened by this routine
    bins: number of bins in histogram, or array of bins for np.histogram
    step: int: training step
docstr_tok: ["Saves","histogram","of","values",".","Args",":","tag",":","str",":","label","for","this","data","values",":","ndarray",":","will","be","flattened","by","this","routine","bins",":","number","of","bins","in","histogram",",","or","array","of","bins","for","np.histogram","step",":","int",":","training","step"]
code: def histogram(self, tag, values, bins, step=None):
      """Saves histogram of values.
  
      Args:
        tag: str: label for this data
        values: ndarray: will be flattened by this routine
        bins: number of bins in histogram, or array of bins for np.histogram
        step: int: training step
      """
      if step is None:
          step = self._step
      else:
          self._step = step
      values = np.array(values)
      bins = np.array(bins)
      values = np.reshape(values, -1)
      counts, limits = np.histogram(values, bins=bins)
      # boundary logic
      cum_counts = np.cumsum(np.greater(counts, 0, dtype=np.int32))
      start, end = np.searchsorted(
          cum_counts, [0, cum_counts[-1] - 1], side="right"
      )
      start, end = int(start), int(end) + 1
      counts = (
          counts[start - 1 : end]
          if start > 0
          else np.concatenate([[0], counts[:end]])
      )
      limits = limits[start : end + 1]
      sum_sq = values.dot(values)
      histo = tf.compat.v1.HistogramProto(
          min=values.min(),
          max=values.max(),
          num=len(values),
          sum=values.sum(),
          sum_squares=sum_sq,
          bucket_limit=limits.tolist(),
          bucket=counts.tolist(),
      )
      summary = tf.compat.v1.Summary(
          value=[tf.compat.v1.Summary.Value(tag=tag, histo=histo)]
      )
      self.add_summary(summary, step)
  
imports: import io
  import struct
  import time
  import warnings
  import wave
  import matplotlib
  import matplotlib.pyplot
  import numpy
  import tensorflow
  from tensorflow.core.util import event_pb2
  from tensorflow.python.summary.writer.event_file_writer import EventFileWriter
label_desc: Use image node_id 11 for calling the SummaryWriter obj's underlying member method code with example usage: obj.histogram(tag, values, bins, step) without return types