1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Add functionality to export small net

Usage
```
export_net <filenameBigNet> <filenameSmallNet>
```

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

No functional change
This commit is contained in:
Disservin 2024-03-23 10:34:32 +01:00
parent 5001d49f42
commit 7998570414

View file

@ -159,11 +159,16 @@ void UCI::loop() {
sync_cout << compiler_info() << sync_endl; sync_cout << compiler_info() << sync_endl;
else if (token == "export_net") else if (token == "export_net")
{ {
std::optional<std::string> filename; std::pair<std::optional<std::string>, std::string> files[2];
std::string f;
if (is >> std::skipws >> f) if (is >> std::skipws >> files[0].second)
filename = f; files[0].first = files[0].second;
networks.big.save(filename);
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") else if (token == "--help" || token == "help" || token == "--license" || token == "license")
sync_cout sync_cout