]> git.sesse.net Git - stockfish/blobdiff - src/uci.cpp
Exporting the currently loaded network file
[stockfish] / src / uci.cpp
index 64bb7a7cb59b41f2093c1ef66de6d5b7f8d7d6ae..bb17b8d79b21ab8cd3e13855bcd404f7b074d545 100644 (file)
@@ -277,7 +277,14 @@ 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 == "export_net") {
+          std::optional<std::string> filename;
+          std::string f;
+          if (is >> skipws >> f) {
+            filename = f;
+          }
+          Eval::NNUE::export_net(filename);
+      }
       else if (!token.empty() && token[0] != '#')
           sync_cout << "Unknown command: " << cmd << sync_endl;