consider one more strings for layer option 94/262694/1
authorInki Dae <inki.dae@samsung.com>
Tue, 17 Aug 2021 11:14:30 +0000 (20:14 +0900)
committerInki Dae <inki.dae@samsung.com>
Wed, 18 Aug 2021 04:49:37 +0000 (13:49 +0900)
Change-Id: I7b24d59c1416630c406d51bbd981a02a5026537f
Signed-off-by: Inki Dae <inki.dae@samsung.com>
src/training_engine_nntrainer.cpp

index 186cbe40b66623409485ff36644a0c3024410001..9ba94015f2e27f4f328bd71151f2454e4f9e4a48 100644 (file)
@@ -179,18 +179,22 @@ namespace NntrainerImpl
 
                TE_CHECK_OBJ(layer, TRAINING_ENGINE_ERROR_INVALID_PARAMETER);
 
-               if (property.option.empty()) {
+               if (property.options.empty()) {
                        LOGE("invalid property.");
                        return TRAINING_ENGINE_ERROR_INVALID_PARAMETER;
                }
 
-               LOGI("layer option : %s", property.option.c_str());
+               LOGI("layer property size : %zu", property.options.size());
 
-               int ret = ml_train_layer_set_property(static_cast<ml_train_layer_h>(layer->layer_handle),
-                                                                                         property.option.c_str(), NULL);
-               if (ret != ML_ERROR_NONE) {
-                       LOGE("Failed to set a layer property.");
-                       return TRAINING_ENGINE_ERROR_INVALID_OPERATION;
+               for (auto opt : property.options) {
+                       LOGI("Set %s property", opt.c_str());
+
+                       int ret = ml_train_layer_set_property(static_cast<ml_train_layer_h>(layer->layer_handle),
+                                                                                               opt.c_str(), NULL);
+                       if (ret != ML_ERROR_NONE) {
+                               LOGE("Failed to set a layer property.");
+                               return TRAINING_ENGINE_ERROR_INVALID_OPERATION;
+                       }
                }
 
                LOGI("LEAVE");