class_docstr: Log writer to write vdl records to log file.
  
  The class `LogWriter` provides APIs to create record file and add records to
  it. The class updates log file asynchronously without slowing down training.
class_docstr_tok: ["Log","writer","to","write","vdl","records","to","log","file",".","The","class","`","LogWriter","`","provides","APIs","to","create","record","file","and","add","records","to","it",".","The","class","updates","log","file","asynchronously","without","slowing","down","training","."]
docstr: Add an histogram to vdl record file.
  
  Args:
      tag (string): Data identifier
      value (np.ndarray or list): value represented by a numpy.array or list
      step (int): Step of histogram
      walltime (int): Wall time of audio
      buckets (int): Number of buckets, default is 10
  
  Example:
      values = np.arange(0, 1000)
      with LogWriter(logdir="./log/histogram_test/train") as writer:
          for index in range(5):
              writer.add_histogram(tag='default',
                                   values=values+index,
                                   step=index)
code: def add_histogram(self, tag, values, step, walltime=None, buckets=10):
      """Add an histogram to vdl record file.
  
      Args:
          tag (string): Data identifier
          value (np.ndarray or list): value represented by a numpy.array or list
          step (int): Step of histogram
          walltime (int): Wall time of audio
          buckets (int): Number of buckets, default is 10
  
      Example:
          values = np.arange(0, 1000)
          with LogWriter(logdir="./log/histogram_test/train") as writer:
              for index in range(5):
                  writer.add_histogram(tag='default',
                                       values=values+index,
                                       step=index)
      """
      if "%" in tag:
          raise RuntimeError("% can't appear in tag!")
      hist, bin_edges = np.histogram(values, bins=buckets)
      walltime = (
          round(time.time() * 1000) if walltime is None else walltime
      )
      self._get_file_writer().add_record(
          histogram(
              tag=tag,
              hist=hist,
              bin_edges=bin_edges,
              step=step,
              walltime=walltime,
          )
      )
  
imports: import os
  import time
  import numpy
  from visualdl.component.base_component import audio
  from visualdl.component.base_component import embedding
  from visualdl.component.base_component import histogram
  from visualdl.component.base_component import hparam
  from visualdl.component.base_component import image
  from visualdl.component.base_component import meta_data
  from visualdl.component.base_component import pr_curve
  from visualdl.component.base_component import roc_curve
  from visualdl.component.base_component import scalar
  from visualdl.component.base_component import scalars
  from visualdl.component.base_component import text
  from visualdl.component.graph import translate_graph
  from visualdl.io import bfile
  from visualdl.server.log import logger
  from visualdl.utils.figure_util import figure_to_image
  from visualdl.utils.img_util import merge_images
  from visualdl.utils.md5_util import md5
  from visualdl.writer.record_writer import RecordFileWriter
label_desc: Use image node_id 14 for calling the LogWriter obj's underlying member method code with example usage: obj.add_histogram(tag, values, step, walltime, buckets) without return types