code: def _write_training_loss(self, iteration:int, last_loss:Tensor)->None:
          "Writes training loss to Tensorboard."
          scalar_value = to_np(last_loss)
          tag = self.metrics_root + 'train_loss'
          self.tbwriter.add_scalar(tag=tag, scalar_value=scalar_value, global_step=iterationf _write_training_loss(self, iteration:int, last_loss:Tensor)->None:
          "Writes training loss to Tensorboard."
          scalar_value = to_np(last_loss)
          tag = self.metrics_root + 'train_loss'
          self.tbwriter.add_scalar(tag=tag, scalar_value=scalar_value, global_step=iteration)
docs: Writes training loss to Tensorboard.