code: def write_epoch(self, cur_epoch):
      basic_stats = self.basic()
  
      # Try to load customized metrics
      task_stats = {}
      for custom_metric in cfg.custom_metrics:
          func = register.metric_dict.get(custom_metric)
          if not func:
              raise ValueError(
                  f"Unknown custom metric function name: {custom_metric}"
              )
          custom_metric_score = func(
              self._true, self._pred, self.task_type
          )
          task_stats[custom_metric] = custom_metric_score
  
      if (
          not task_stats
      ):  # use default metrics if no matching custom metric
          if self.task_type == "regression":
              task_stats = self.regression()
          elif self.task_type == "classification_binary":
              task_stats = self.classification_binary()
          elif self.task_type == "classification_multi":
              task_stats = self.classification_multi()
          else:
              raise ValueError(
                  "Task has to be regression or classification"
              )
  
      epoch_stats = {"epoch": cur_epoch}
      eta_stats = {"eta": round(self.eta(cur_epoch), cfg.round)}
      custom_stats = self.custom()
  
      if self.name == "train":
          stats = {
              **epoch_stats,
              **eta_stats,
              **basic_stats,
              **task_stats,
              **custom_stats,
          }
      else:
          stats = {
              **epoch_stats,
              **basic_stats,
              **task_stats,
              **custom_stats,
          }
  
      # print
      logging.info("{}: {}".format(self.name, stats))
      # json
      dict_to_json(stats, "{}/stats.json".format(self.out_dir))
      # tensorboard
      if cfg.tensorboard_each_run:
          dict_to_tb(stats, self.tb_writer, cur_epoch)
      self.reset()
  
imports: import logging
  import math
  import sys
  import torch
  import graphgym.register
  from graphgym.config import cfg
  from graphgym.utils.device import get_current_gpu_usage
  from graphgym.utils.io import dict_to_json, dict_to_tb, makedirs
label_desc: Use image node_id 15 for calling the Logger obj's underlying member method code with example usage: obj.write_epoch(cur_epoch) without return types