Add an UCI level command "export_net".

This command writes the embedded net to the file `EvalFileDefaultName`.
If there is no embedded net the command does nothing.

fixes #3453

closes https://github.com/official-stockfish/Stockfish/pull/3454

No functional change
This commit is contained in:
Tomasz Sobczyk
2021-05-02 18:50:09 +02:00
committed by Joost VandeVondele
parent b1c8840f10
commit ca250e969c
4 changed files with 23 additions and 6 deletions

View File

@@ -277,6 +277,7 @@ void UCI::loop(int argc, char* argv[]) {
else if (token == "d") sync_cout << pos << sync_endl;
else if (token == "eval") trace_eval(pos);
else if (token == "compiler") sync_cout << compiler_info() << sync_endl;
else if (token == "export_net") Eval::NNUE::export_net();
else if (!token.empty() && token[0] != '#')
sync_cout << "Unknown command: " << cmd << sync_endl;