From 764c2c57a36676c41f490e6166ce200f4efa8341 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=84=B8=ED=9D=AC/On-Device=20Lab=28SR=29/Princip?= =?utf8?q?al=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Wed, 5 Jun 2019 09:27:54 +0900 Subject: [PATCH] [moco/tf] Register two transforms (#3683) This will register and run (currently dummy) two transforms after loading the graph Signed-off-by: SaeHie Park --- contrib/moco/lib/frontend/tf/src/Frontend.cpp | 10 ++++++---- contrib/moco/lib/frontend/tf/src/Transforms.h | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 contrib/moco/lib/frontend/tf/src/Transforms.h diff --git a/contrib/moco/lib/frontend/tf/src/Frontend.cpp b/contrib/moco/lib/frontend/tf/src/Frontend.cpp index ce47a20..1ec7d57 100644 --- a/contrib/moco/lib/frontend/tf/src/Frontend.cpp +++ b/contrib/moco/lib/frontend/tf/src/Frontend.cpp @@ -19,8 +19,7 @@ #include "GraphBuilder.h" #include "GraphBuilderContext.h" #include "GraphBuilderRegistry.h" - -#include "Transforms/Transform.h" +#include "Transforms.h" #include #include @@ -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()); + // TODO add one time finalization when needed } // Transforms that run multiple times until there is no transform occured { + transforms.emplace_back(stdex::make_unique()); // 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 index 0000000..ea1aedd --- /dev/null +++ b/contrib/moco/lib/frontend/tf/src/Transforms.h @@ -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__ -- 2.7.4