class_docstr: A callback that writes training statistics/metrics to TensorBoard.
class_docstr_tok: ["A","callback","that","writes","training","statistics\/metrics","to","TensorBoard","."]
docstr: Calls the `close` method of the `SummaryWriter` s which makes sure that pending
  scalars are flushed to disk and the tensorboard event files are closed properly.
docstr_tok: ["Calls","the","`","close","`","method","of","the","`","SummaryWriter","`","s","which","makes","sure","that","pending","scalars","are","flushed","to","disk","and","the","tensorboard","event","files","are","closed","properly","."]
code: def close(self) -> None:
      """
      Calls the `close` method of the `SummaryWriter` s which makes sure that pending
      scalars are flushed to disk and the tensorboard event files are closed properly.
      """
      super().close()
      if self._train_log is not None:
          self._train_log.close()
      if self._validation_log is not None:
          self._validation_log.close()
  
file_path: allennlp/allennlp/training/callbacks/tensorboard.py
imports: import os
  from typing import Dict, Union, Optional
  from tensorboardX import SummaryWriter
  import torch
  from allennlp.training.callbacks.callback import TrainerCallback
  from allennlp.training.callbacks.log_writer import LogWriterCallback
label_desc: Use image node_id 4 for calling the TensorBoardCallback obj's underlying member method code with example usage: obj.close() without return types