Skip to content

Commit

Permalink
don't save empty stats
Browse files Browse the repository at this point in the history
  • Loading branch information
ngc92 committed Nov 5, 2023
1 parent c9c9826 commit 37344c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/training/statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void TrainingStatsGatherer::finalize() {
}

TrainingStatsGatherer::~TrainingStatsGatherer() {
if(!m_TargetFile.empty()) {
if(!m_TargetFile.empty() && !m_Merged.empty()) {
nlohmann::json result = to_json();
std::fstream target(m_TargetFile, std::fstream::out);
target << std::setw(2) << result << "\n";
Expand Down

0 comments on commit 37344c0

Please sign in to comment.