key.erase(0, 1);
try {
input_index = std::stoi(key);
- if (input_index < 0 | input_index > 9) {
+ if (input_index < 0 | input_index > 99) {
throw std::out_of_range("");
}
} catch (std::invalid_argument&) {
THROW_GNA_EXCEPTION << "Invalid value of index of input scale factor";
} catch (std::out_of_range&) {
- THROW_GNA_EXCEPTION << "Index of input scale factor must be in the range [0..9], " << value << " provided";
+ THROW_GNA_EXCEPTION << "Index of input scale factor must be in the range [0..99], " << key << " provided";
}
}
auto scale_factor = InferenceEngine::CNNLayer::ie_parse_float(value);
EXPECT_FLOAT_EQ(config.inputScaleFactors[2], 1.0);
EXPECT_FLOAT_EQ(config.inputScaleFactors[3], 15.2);
- config.UpdateFromMap({{GNA_CONFIG_KEY(SCALE_FACTOR) + std::string("_9"), std::string("8.43")}});
- EXPECT_EQ(config.GetParameter(GNA_CONFIG_KEY(SCALE_FACTOR) + std::string("_9")), std::string("8.430000"));
- EXPECT_EQ(config.inputScaleFactors.size(), 10);
- EXPECT_FLOAT_EQ(config.inputScaleFactors[9], 8.43);
+ config.UpdateFromMap({{GNA_CONFIG_KEY(SCALE_FACTOR) + std::string("_99"), std::string("8.43")}});
+ EXPECT_EQ(config.GetParameter(GNA_CONFIG_KEY(SCALE_FACTOR) + std::string("_99")), std::string("8.430000"));
+ EXPECT_EQ(config.inputScaleFactors.size(), 100);
+ EXPECT_FLOAT_EQ(config.inputScaleFactors[99], 8.43);
- ExpectThrow(GNA_CONFIG_KEY(SCALE_FACTOR) + std::string("_10"), std::string("8.43"));
+ ExpectThrow(GNA_CONFIG_KEY(SCALE_FACTOR) + std::string("_100"), std::string("8.43"));
ExpectThrow(GNA_CONFIG_KEY(SCALE_FACTOR) + std::string("&1"), std::string("8.43"));
ExpectThrow(GNA_CONFIG_KEY(SCALE_FACTOR) + std::string("_"), std::string("8.43"));
ExpectThrow(GNA_CONFIG_KEY(SCALE_FACTOR) + std::string("abs"), std::string("8.43"));