1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00

update evaluate_nnue.cpp

rename kFileName and change to std:string
This commit is contained in:
FireFather 2020-07-08 04:23:50 +02:00
parent c59583bbf0
commit d1760a1f15
3 changed files with 6 additions and 6 deletions

View file

@ -23,7 +23,7 @@ AlignedPtr<FeatureTransformer> feature_transformer;
AlignedPtr<Network> network;
// Evaluation function file name
const char* kFileName = "eval\\nn.bin";
std::string fileName = "eval\\nn.bin";
// Get a string that represents the structure of the evaluation function
std::string GetArchitectureString() {
@ -244,17 +244,17 @@ void load_eval() {
}
const std::string file_name = Options["EvalFile"];
NNUE::kFileName = file_name.c_str();
NNUE::fileName = file_name;
std::ifstream stream(file_name, std::ios::binary);
const bool result = NNUE::ReadParameters(stream);
if (!result)
// It's a problem if it doesn't finish when there is a read error.
std::cout << "Error! " << NNUE::kFileName << " not found or wrong format" << std::endl;
std::cout << "Error! " << NNUE::fileName << " not found or wrong format" << std::endl;
else
std::cout << "info string NNUE " << NNUE::kFileName << " found & loaded" << std::endl;
std::cout << "info string NNUE " << NNUE::fileName << " found & loaded" << std::endl;
}
// Initialization

View file

@ -36,7 +36,7 @@ extern AlignedPtr<FeatureTransformer> feature_transformer;
extern AlignedPtr<Network> network;
// Evaluation function file name
extern const char* kFileName;
extern std::string fileName;
// Get a string that represents the structure of the evaluation function
std::string GetArchitectureString();

View file

@ -190,7 +190,7 @@ void TestCommand(Position& pos, std::istream& stream) {
} else {
std::cout << "usage:" << std::endl;
std::cout << " test nnue test_features" << std::endl;
std::cout << " test nnue info [path/to/" << kFileName << "...]" << std::endl;
std::cout << " test nnue info [path/to/" << fileName << "...]" << std::endl;
}
}