Skip to content

Commit

Permalink
Post merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sopel97 committed May 13, 2021
1 parent 8f0dbc9 commit 2421a88
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
36 changes: 18 additions & 18 deletions src/evaluate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,28 +127,28 @@ namespace Eval {
}
}

void NNUE::export_net(const std::optional<std::string>& filename) {
std::string actualFilename;
if (filename.has_value()) {
actualFilename = filename.value();
} else {
if (eval_file_loaded != EvalFileDefaultName) {
sync_cout << "Failed to export a net. A non-embedded net can only be saved if the filename is specified." << sync_endl;
return;
void export_net(const std::optional<std::string>& filename) {
std::string actualFilename;
if (filename.has_value()) {
actualFilename = filename.value();
} else {
if (eval_file_loaded != EvalFileDefaultName) {
sync_cout << "Failed to export a net. A non-embedded net can only be saved if the filename is specified." << sync_endl;
return;
}
actualFilename = EvalFileDefaultName;
}
actualFilename = EvalFileDefaultName;
}

ofstream stream(actualFilename, std::ios_base::binary);
if (save_eval(stream)) {
sync_cout << "Network saved successfully to " << actualFilename << "." << sync_endl;
} else {
sync_cout << "Failed to export a net." << sync_endl;
ofstream stream(actualFilename, std::ios_base::binary);
if (save_eval(stream)) {
sync_cout << "Network saved successfully to " << actualFilename << "." << sync_endl;
} else {
sync_cout << "Failed to export a net." << sync_endl;
}
}
}

/// NNUE::verify() verifies that the last net used was loaded successfully
void NNUE::verify() {
/// NNUE::verify() verifies that the last net used was loaded successfully
void verify() {

string eval_file = string(Options["EvalFile"]);

Expand Down
2 changes: 1 addition & 1 deletion src/nnue/nnue_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef NNUE_COMMON_H_INCLUDED
#define NNUE_COMMON_H_INCLUDED

#include "types.h"
#include "../types.h"

#include <cstring>
#include <iostream>
Expand Down
1 change: 1 addition & 0 deletions src/nnue/nnue_feature_transformer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "nnue_architecture.h"

#include "../misc.h"
#include "../position.h"

#include <cstring> // std::memset()

Expand Down

0 comments on commit 2421a88

Please sign in to comment.