MCPcopy
hub / github.com/QData/TextAttack / _tb_log

Method _tb_log

textattack/trainer.py:303–312  ·  view source on GitHub ↗
(self, log, step)

Source from the content-addressed store, hash-verified

301 )
302
303 def _tb_log(self, log, step):
304 if not hasattr(self, "_tb_writer"):
305 from torch.utils.tensorboard import SummaryWriter
306
307 self._tb_writer = SummaryWriter(self.training_args.tb_log_dir)
308 self._tb_writer.add_hparams(self.training_args.__dict__, {})
309 self._tb_writer.flush()
310
311 for key in log:
312 self._tb_writer.add_scalar(key, log[key], step)
313
314 def _wandb_log(self, log, step):
315 if not hasattr(self, "_wandb_init"):

Callers 1

trainMethod · 0.95

Calls 1

flushMethod · 0.45

Tested by

no test coverage detected