Add output layer info to GetOutputLayerProperty api 88/235288/4 accepted/tizen/unified/20200616.062021 submit/tizen/20200616.011635
authorHyunsoo Park <hance.park@samsung.com>
Wed, 3 Jun 2020 10:07:10 +0000 (19:07 +0900)
committerHyunsoo Park <hance.park@samsung.com>
Wed, 3 Jun 2020 11:14:30 +0000 (20:14 +0900)
From this patch,
GetOutputLayerProperty api could be called without calling SetOutputLayerProperty api.

Change-Id: I2c7987d4923fb4f23ea3545d9f6861d8cebf10c6
Signed-off-by: Hyunsoo Park <hance.park@samsung.com>
packaging/inference-engine-tflite.spec
src/inference_engine_tflite.cpp

index d9f9b72083da758a1022c329b69c4009ad67e753..ab41e13f60446f3abae921970e5bb382f7906e3f 100644 (file)
@@ -1,7 +1,7 @@
 Name:       inference-engine-tflite
 Summary:    Tensorflow-Lite based implementation of inference-engine-interface
 Version:    0.0.1
-Release:    11
+Release:    12
 Group:      Multimedia/Libraries
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
index 9982d4346ba4d4e5528578b079d59b0f8e102d2b..acf783433cc31107e8d967faf5db06fbf3a25601 100644 (file)
@@ -234,19 +234,17 @@ int InferenceTFLite::GetOutputLayerProperty(inference_engine_layer_property &pro
 {
     LOGI("ENTER");
 
-    if (mOutputLayer.empty()) {
-        LOGI("mOutputLayer is empty");
-        return INFERENCE_ENGINE_ERROR_INVALID_OPERATION;
-    }
-
     std::vector<inference_engine_tensor_info>().swap(mOutputTensorInfo);
-    int idx = 0;
-    for (std::vector<int>::iterator iter = mOutputLayerId.begin(); iter != mOutputLayerId.end(); ++iter, ++idx) {
+
+    for (std::vector<int>::iterator iter = mOutputLayerId.begin(); iter != mOutputLayerId.end(); ++iter) {
         LOGI("output layer ID: %d", (*iter));
         if((*iter) < 0) {
             LOGE("Invalid output layer");
             return INFERENCE_ENGINE_ERROR_INVALID_OPERATION;
         }
+
+        mOutputLayer.push_back(mInterpreter->tensor((*iter))->name);
+
         inference_engine_tensor_info tensor_info;
 
         LOGI("mInterpreter->tensor((*iter))->dims name[%s]", mInterpreter->tensor((*iter))->name);