class_docstr: TensorBoard callback which writes metrics to the given log directory. Requires the TensorboardX library for python.
  
  Args:
      log_dir (str): The tensorboard log path for output
      comment (str): Descriptive comment to append to path
      visdom (bool): If true, log to visdom instead of tensorboard
      visdom_params (VisdomParams): Visdom parameter settings object, uses default if None
  
  State Requirements:
      - :attr:`torchbearer.state.MODEL`: PyTorch model
class_docstr_tok: ["TensorBoard","callback","which","writes","metrics","to","the","given","log","directory",".","Requires","the","TensorboardX","library","for","python",".","Args",":","log_dir","(","str",")",":","The","tensorboard","log","path","for","output","comment","(","str",")",":","Descriptive","comment","to","append","to","path","visdom","(","bool",")",":","If","true",",","log","to","visdom","instead","of","tensorboard","visdom_params","(","VisdomParams",")",":","Visdom","parameter","settings","object",",","uses","default","if","None","State","Requirements",":","-",":","attr",":","`","torchbearer.state.MODEL","`",":","PyTorch","model"]
docstr: Decrement the reference count for a writer belonging to the given log directory
  (or the default writer if the directory is not given). If the reference count gets to zero,
  the writer will be closed and removed.
  
  Args:
      log_dir (str): the (optional) directory
docstr_tok: ["Decrement","the","reference","count","for","a","writer","belonging","to","the","given","log","directory","(","or","the","default","writer","if","the","directory","is","not","given",")",".","If","the","reference","count","gets","to","zero",",","the","writer","will","be","closed","and","removed",".","Args",":","log_dir","(","str",")",":","the","(","optional",")","directory"]
code: def close_writer(self, log_dir=None):
      """
      Decrement the reference count for a writer belonging to the given log directory
      (or the default writer if the directory is not given). If the reference count gets to zero,
      the writer will be closed and removed.
  
      Args:
          log_dir (str): the (optional) directory
      """
      if log_dir is None:
          close_writer(self.log_dir, self)
      else:
          close_writer(log_dir, self)
  
imports: import copy
  import os
  import warnings
  import torch
  import torch.nn.functional
  import torchbearer
  from torchbearer.callbacks import Callback
label_desc: Use image node_id 3 for calling the AbstractTensorBoard obj's underlying member method code with example usage: obj.close_writer(log_dir) without return types