[nnkit-mocotf] Set shape information in ModelSignature (#8289)
author남궁석/On-Device Lab(SR)/Engineer/삼성전자 <sk.namkoong@samsung.com>
Fri, 18 Oct 2019 00:42:38 +0000 (09:42 +0900)
committer박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Fri, 18 Oct 2019 00:42:38 +0000 (09:42 +0900)
This commit will enable setting shape information in `ModelSignature`
at `nnkit-mocotf`

Signed-off-by: Seok NamKoong <sk.namkoong@samsung.com>
compiler/nnkit-mocotf/support/src/Backend.cpp

index 51e1f7f..82d93bd 100644 (file)
@@ -54,11 +54,13 @@ Backend::Backend(const char *pb_path, const char *info_path)
     if (parsed_tensor->kind() == ParsedTensor::Kind::Input)
     {
       sig.add_input(::moco::tf::TensorName(parsed_tensor->name()));
+      sig.shape(parsed_tensor->name(), parsed_tensor->shape());
       _inputs.emplace_back(std::move(parsed_tensor));
     }
     else
     {
       sig.add_output(::moco::tf::TensorName(parsed_tensor->name()));
+      sig.shape(parsed_tensor->name(), parsed_tensor->shape());
       _outputs.emplace_back(std::move(parsed_tensor));
     }
   }