def METHOD_NAME(self, state: State, logger: Logger) -> None:
    # Give the metrics used for hparams a unique name, so they don't get plotted in the
    # normal metrics plot.
    metrics_for_hparams = {
        'hparams/' + name: metric
        for name, metric in self.current_metrics.items()
        if 'metric' in name or 'loss' in name
    }
    assert self.writer is not None
    self.writer.add_hparams(hparam_dict=self.hyperparameters,
                            metric_dict=metrics_for_hparams,
                            run_name=self.run_name)
    self._flush(logger)