class_docstr: Callback that streams epoch results to tensorboard events folder.
  
  Supports all values that can be represented as a string,
  including 1D iterables such as `np.ndarray`.
  
  
  ```python
  tensorboard_logger = TensorBoard('runs')
  model.fit(X_train, Y_train, callbacks=[tensorboard_logger])
  ```
class_docstr_tok: ["Callback","that","streams","epoch","results","to","tensorboard","events","folder",".","Supports","all","values","that","can","be","represented","as","a","string",",","including","1D","iterables","such","as","`","np.ndarray","`",".","``","`","python","tensorboard_logger","=","TensorBoard","(","'runs","'",")","model.fit","(","X_train",",","Y_train",",","callbacks=","[","tensorboard_logger","]",")","``","`"]
code: def on_epoch_end(self, epoch, logs=None):
      # if self.model.stop_training:
      #     return
  
      logs = logs or {}
  
      if self.keys is None:
          self.keys = logs.keys()
  
      # logs on on_{train, test}_batch_end do not have val metrics
      if self.write_per_batch:
          for key in logs:
              if "val" in key:
                  self.val_writer.add_scalar(
                      key.replace("val_", ""),
                      logs[key],
                      self.global_step,
                  )
          return
  
      elif epoch % self.update_freq == 0:
          for key in logs:
              if "val" in key and key:
                  self.val_writer.add_scalar(
                      key.replace("val_", ""), logs[key], epoch
                  )
              else:
                  self.train_writer.add_scalar(key, logs[key], epoch)
  
file_path: elegy/elegy/callbacks/tensorboard.py
imports: import os
  import typing
  from typing import Any, Dict, Optional, Union
  from tensorboardX.writer import SummaryWriter
  from .callback import Callback
label_desc: Use image node_id 5 for calling the TensorBoard obj's underlying member method code with example usage: obj.on_epoch_end(epoch, logs) without return types