[GNA] fix custom scale factors when importing a model (#1096)

This commit is contained in:
Anna Alberska 2020-06-25 11:43:47 +02:00 committed by GitHub
parent 0f1c8a0763
commit 0b9987f5e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -603,12 +603,13 @@ int main(int argc, char *argv[]) {
if (FLAGS_q.compare("user") == 0) {
auto scaleFactorInput = ParseScaleFactors(FLAGS_sf);
if (scaleFactorInput.size() != network.getInputsInfo().size()) {
if (numInputArkFiles != scaleFactorInput.size()) {
std::string errMessage("Incorrect command line for multiple inputs: "
+ std::to_string(scaleFactorInput.size()) + " scale factors provided for "
+ std::to_string(network.getInputsInfo().size()) + " inputs.");
+ std::to_string(scaleFactorInput.size()) + " scale factors provided for "
+ std::to_string(numInputArkFiles) + " input files.");
throw std::logic_error(errMessage);
}
for (size_t i = 0; i < scaleFactorInput.size(); ++i) {
slog::info << "For input " << i << " using scale factor of " << scaleFactorInput[i] << slog::endl;
std::string scaleFactorConfigKey = GNA_CONFIG_KEY(SCALE_FACTOR) + std::string("_") + std::to_string(i);