code: def build_report_manager(opt, gpu_rank):
      if opt.tensorboard and gpu_rank <= 0:
          from torch.utils.tensorboard import SummaryWriter
  
          if not hasattr(opt, "tensorboard_log_dir_dated"):
              opt.tensorboard_log_dir_dated = (
                  opt.tensorboard_log_dir
                  + datetime.now().strftime("/%b-%d_%H-%M-%S")
              )
          writer = SummaryWriter(
              opt.tensorboard_log_dir_dated, comment="Unmt"
          )
      else:
          writer = None
  
      report_mgr = ReportMgr(
          opt.report_every, start_time=-1, tensorboard_writer=writer
      )
      return report_mgr
  
imports: import time
  from datetime import datetime
  import onmt
  from onmt.utils.logging import logger
label_desc: Use image node_id 1 for calling a global function with example usage: build_report_manager(opt, gpu_rank) and returns: report_mgr