docstr: Args:
      tf_name (str): name of tensorflow variable
      value (tuple or list): either a tuple of bin_edges and bincounts or
          a list of values to summarize in a histogram.
  
  References:
      https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/04-utils/tensorboard/logger.py#L45
  
  Example:
      >>> tf_name = 'foo'
      >>> value = ([0, 1, 2, 3, 4, 5], [1, 20, 10, 22, 11])
      >>> self = Logger(None, is_dummy=True)
      >>> summary = self._histogram_summary(tf_name, value, step=None)
      >>> assert summary.value[0].histo.max == 5
  
  Example:
      >>> tf_name = 'foo'
      >>> value = [0.72,  0.18,  0.34,  0.66,  0.11,  0.70,  0.23]
      >>> self = Logger(None, is_dummy=True)
      >>> summary = self._histogram_summary(tf_name, value, step=None)
      >>> assert summary.value[0].histo.num == 7.0
docstr_tok: ["Args",":","tf_name","(","str",")",":","name","of","tensorflow","variable","value","(","tuple","or","list",")",":","either","a","tuple","of","bin_edges","and","bincounts","or","a","list","of","values","to","summarize","in","a","histogram",".","References",":","https",":","\/\/github.com\/yunjey\/pytorch-tutorial\/blob\/master\/tutorials\/04-utils\/tensorboard\/logger.py","#","L45","Example",":",">",">",">","tf_name","=","'foo'",">",">",">","value","=","(","[","0",",","1",",","2",",","3",",","4",",","5","]",",","[","1",",","20",",","10",",","22",",","11","]",")",">",">",">","self","=","Logger","(","None",",","is_dummy=True",")",">",">",">","summary","=","self._histogram_summary","(","tf_name",",","value",",","step=None",")",">",">",">","assert","summary.value","[","0","]",".histo.max","==","5","Example",":",">",">",">","tf_name","=","'foo'",">",">",">","value","=","[","0.72",",","0.18",",","0.34",",","0.66",",","0.11",",","0.70",",","0.23","]",">",">",">","self","=","Logger","(","None",",","is_dummy=True",")",">",">",">","summary","=","self._histogram_summary","(","tf_name",",","value",",","step=None",")",">",">",">","assert","summary.value","[","0","]",".histo.num","==","7.0"]
code: def _histogram_summary(self, tf_name, value, step=None):
      """
      Args:
          tf_name (str): name of tensorflow variable
          value (tuple or list): either a tuple of bin_edges and bincounts or
              a list of values to summarize in a histogram.
  
      References:
          https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/04-utils/tensorboard/logger.py#L45
  
      Example:
          >>> tf_name = 'foo'
          >>> value = ([0, 1, 2, 3, 4, 5], [1, 20, 10, 22, 11])
          >>> self = Logger(None, is_dummy=True)
          >>> summary = self._histogram_summary(tf_name, value, step=None)
          >>> assert summary.value[0].histo.max == 5
  
      Example:
          >>> tf_name = 'foo'
          >>> value = [0.72,  0.18,  0.34,  0.66,  0.11,  0.70,  0.23]
          >>> self = Logger(None, is_dummy=True)
          >>> summary = self._histogram_summary(tf_name, value, step=None)
          >>> assert summary.value[0].histo.num == 7.0
      """
      if isinstance(value, tuple):
          bin_edges, bincounts = value
          assert (
              len(bin_edges) == len(bincounts) + 1
          ), "must have one more edge than count"
          hist = summary_pb2.HistogramProto()
          hist.min = float(min(bin_edges))
          hist.max = float(max(bin_edges))
      else:
          values = np.array(value)
  
          bincounts, bin_edges = np.histogram(values)
  
          hist = summary_pb2.HistogramProto()
          hist.min = float(np.min(values))
          hist.max = float(np.max(values))
          hist.num = int(np.prod(values.shape))
          hist.sum = float(np.sum(values))
          hist.sum_squares = float(np.sum(values**2))
  
      # Add bin edges and counts
      for edge in bin_edges[1:]:
          hist.bucket_limit.append(edge)
      for v in bincounts:
          hist.bucket.append(v)
  
      summary = summary_pb2.Summary()
      summary.value.add(tag=tf_name, histo=hist)
      return summary
  
imports: from collections import defaultdict
  import os
  import re
  import socket
  import struct
  import time
  import numpy
  import six
  import scipy.misc
  from .crc32c import crc32c
label_desc: Use image node_id 8 for calling the Logger obj's underlying member method code with example usage: obj._histogram_summary(tf_name, value, step) and returns: summary