class_docstr: Represents a histogram of real-valued events.
  
  A histogram is a list of counts, each over a range of values.
  For example, given this list of values [0.5, 0.0, 1.0, 0.6, 1.5, 2.4, 0.1],
  a histogram over 3 ranges [0, 1), [1, 2), [2, 3) would be:
    [0, 1): 4
    [1, 2): 2
    [2, 3): 1
  Each range is inclusive in the lower bound and exclusive in the upper bound
  (hence the square open bracket but curved close bracket).
  
  Usage examples:
      A distribution over input/output lengths.
      A distribution over compute times.
docstr: Initializes the histogram with the given ranges.
  
  Args:
    name: String name of this histogram.
    buckets: The ranges the histogram counts over. This is a list of values,
        where each value is the inclusive lower bound of the range. An extra
        range will be implicitly defined which spans from negative infinity
        to the lowest given lower bound. The highest given lower bound
        defines a range spaning to positive infinity. This way any value will
        be included in the histogram counts. For example, if `buckets` is
        [4, 6, 10] the histogram will have ranges
        [-inf, 4), [4, 6), [6, 10), [10, inf).
    verbose_pretty_print: If True, self.pretty_print will print the count for
        every bucket. If False, only buckets with positive counts will be
        printed.
docstr_tok: ["Initializes","the","histogram","with","the","given","ranges",".","Args",":","name",":","String","name","of","this","histogram",".","buckets",":","The","ranges","the","histogram","counts","over",".","This","is","a","list","of","values",",","where","each","value","is","the","inclusive","lower","bound","of","the","range",".","An","extra","range","will","be","implicitly","defined","which","spans","from","negative","infinity","to","the","lowest","given","lower","bound",".","The","highest","given","lower","bound","defines","a","range","spaning","to","positive","infinity",".","This","way","any","value","will","be","included","in","the","histogram","counts",".","For","example",",","if","`","buckets","`","is","[","4",",","6",",","10","]","the","histogram","will","have","ranges","[","-inf",",","4",")",",","[","4",",","6",")",",","[","6",",","10",")",",","[","10",",","inf",")",".","verbose_pretty_print",":","If","True",",","self.pretty_print","will","print","the","count","for","every","bucket",".","If","False",",","only","buckets","with","positive","counts","will","be","printed","."]
code: def __init__(self, name, buckets, verbose_pretty_print=False):
      """Initializes the histogram with the given ranges.
  
      Args:
        name: String name of this histogram.
        buckets: The ranges the histogram counts over. This is a list of values,
            where each value is the inclusive lower bound of the range. An extra
            range will be implicitly defined which spans from negative infinity
            to the lowest given lower bound. The highest given lower bound
            defines a range spaning to positive infinity. This way any value will
            be included in the histogram counts. For example, if `buckets` is
            [4, 6, 10] the histogram will have ranges
            [-inf, 4), [4, 6), [6, 10), [10, inf).
        verbose_pretty_print: If True, self.pretty_print will print the count for
            every bucket. If False, only buckets with positive counts will be
            printed.
      """
      super(Histogram, self).__init__(name)
  
      # List of inclusive lowest values in each bucket.
      self.buckets = [float("-inf")] + sorted(set(buckets))
      self.counters = dict(
          (bucket_lower, 0) for bucket_lower in self.buckets
      )
      self.verbose_pretty_print = verbose_pretty_print
  
imports: import abc
  import bisect
  import copy
  import tensorflow.compat.v1
label_desc: Use image node_id 1 to create a new Histogram object from inherited base classes: Statistic with example: obj = Histogram(name, buckets, verbose_pretty_print)