[moco/tf] Register two transforms (#3683)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Wed, 5 Jun 2019 00:27:54 +0000 (09:27 +0900)
committer박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Wed, 5 Jun 2019 00:27:54 +0000 (09:27 +0900)
This will register and run (currently dummy) two transforms after loading the graph

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
contrib/moco/lib/frontend/tf/src/Frontend.cpp
contrib/moco/lib/frontend/tf/src/Transforms.h [new file with mode: 0644]

index ce47a20..1ec7d57 100644 (file)
@@ -19,8 +19,7 @@
 #include "GraphBuilder.h"
 #include "GraphBuilderContext.h"
 #include "GraphBuilderRegistry.h"
-
-#include "Transforms/Transform.h"
+#include "Transforms.h"
 
 #include <loco/IR/Verifier.h>
 #include <cwrap/Fildes.h>
@@ -231,13 +230,16 @@ void transform_graph(loco::Graph *graph)
 
   // Transforms that run only once for preparation and finalization
   {
-      // TODO add one time preparation when needed
+    // TODO add one time preparation when needed
 
-      // TODO add one time finalization when needed
+    // To remove frontend temporary annotations
+    finalize.emplace_back(stdex::make_unique<moco::tf::ClearAnnotTransform>());
+    // TODO add one time finalization when needed
   }
 
   // Transforms that run multiple times until there is no transform occured
   {
+    transforms.emplace_back(stdex::make_unique<moco::tf::FixShapeTransform>());
     // TODO add more TensorFlow related transformations
   }
 
diff --git a/contrib/moco/lib/frontend/tf/src/Transforms.h b/contrib/moco/lib/frontend/tf/src/Transforms.h
new file mode 100644 (file)
index 0000000..ea1aedd
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __MOCO_TF_TRANSFORMS_H__
+#define __MOCO_TF_TRANSFORMS_H__
+
+#include "Transforms/ClearAnnotTransform.h"
+#include "Transforms/FixShapeTransform.h"
+
+#endif // __MOCO_TF_TRANSFORMS_H__