From 7998570414ba489b3dfe239b424c200041396e7f Mon Sep 17 00:00:00 2001 From: Disservin Date: Sat, 23 Mar 2024 10:34:32 +0100 Subject: [PATCH] Add functionality to export small net Usage ``` export_net ``` closes https://github.com/official-stockfish/Stockfish/pull/5133 No functional change --- src/uci.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/uci.cpp b/src/uci.cpp index cc03005f..25884f57 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -159,11 +159,16 @@ void UCI::loop() { sync_cout << compiler_info() << sync_endl; else if (token == "export_net") { - std::optional filename; - std::string f; - if (is >> std::skipws >> f) - filename = f; - networks.big.save(filename); + std::pair, std::string> files[2]; + + if (is >> std::skipws >> files[0].second) + files[0].first = files[0].second; + + if (is >> std::skipws >> files[1].second) + files[1].first = files[1].second; + + networks.big.save(files[0].first); + networks.small.save(files[1].first); } else if (token == "--help" || token == "help" || token == "--license" || token == "license") sync_cout -- 2.39.5