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: Get a SummaryWriter for the given directory (or the default writer if the directory is not given).
  If you are getting a `SummaryWriter` for a custom directory, it is your responsibility to close
  it using `close_writer`.
  
  Args:
      log_dir (str): the (optional) directory
      visdom (bool): If true, return VisdomWriter, if false return tensorboard SummaryWriter
      visdom_params (VisdomParams): Visdom parameter settings object, uses default if None
  
  Returns:
      the `SummaryWriter` or `VisdomWriter`
docstr_tok: ["Get","a","SummaryWriter","for","the","given","directory","(","or","the","default","writer","if","the","directory","is","not","given",")",".","If","you","are","getting","a","`","SummaryWriter","`","for","a","custom","directory",",","it","is","your","responsibility","to","close","it","using","`","close_writer","`",".","Args",":","log_dir","(","str",")",":","the","(","optional",")","directory","visdom","(","bool",")",":","If","true",",","return","VisdomWriter",",","if","false","return","tensorboard","SummaryWriter","visdom_params","(","VisdomParams",")",":","Visdom","parameter","settings","object",",","uses","default","if","None","Returns",":","the","`","SummaryWriter","`","or","`","VisdomWriter","`"]
code: def get_writer(self, log_dir=None, visdom=False, visdom_params=None):
      """
      Get a SummaryWriter for the given directory (or the default writer if the directory is not given).
      If you are getting a `SummaryWriter` for a custom directory, it is your responsibility to close
      it using `close_writer`.
  
      Args:
          log_dir (str): the (optional) directory
          visdom (bool): If true, return VisdomWriter, if false return tensorboard SummaryWriter
          visdom_params (VisdomParams): Visdom parameter settings object, uses default if None
  
      Returns:
          the `SummaryWriter` or `VisdomWriter`
      """
      if log_dir is None:
          self.writer = get_writer(
              self.log_dir,
              self,
              visdom=visdom,
              visdom_params=visdom_params,
          )
          return self.writer
      else:
          return get_writer(
              log_dir, self, visdom=visdom, visdom_params=visdom_params
          )
  
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 2 for calling the AbstractTensorBoard obj's underlying member method code with example usage: obj.get_writer(log_dir, visdom, visdom_params) and returns: self, get_writer