def save(self) -> None:
        """
        Save the training trace to :py:attr:`CXF_TRACE_FILE` file under the specified directory.

        :raise ValueError: if no output directory was specified
        """
        if self._output_dir is None:
            raise ValueError('Can not save TrainingTrace without output dir.')
        yaml_to_file(self._trace, self._output_dir, CXF_TRACE_FILE)