From 6712b37fb787112a10978b8182b415c12a34a0b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9C=A4=ED=98=84=EC=8B=9D/On-Device=20Lab=28SR=29/Princip?= =?utf8?q?al=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Fri, 2 Aug 2019 13:01:07 +0900 Subject: [PATCH] [moco-tf] Removing CompilerArgs.h (#6133) With this commit, CompilerArgs.h was removed and header inclusion errors were fixed. Signed-off-by: Hyun Sik Yoon --- compiler/moco-tf/src/CompilerArgs.h | 85 ---------------------------- compiler/moco-tf/src/CompilerArgs.test.cpp | 29 ---------- compiler/moco-tf/src/Op/Add.test.cpp | 1 - compiler/moco-tf/src/Op/Mul.test.cpp | 1 - compiler/moco-tf/src/Op/Placeholder.test.cpp | 1 - 5 files changed, 117 deletions(-) delete mode 100644 compiler/moco-tf/src/CompilerArgs.h delete mode 100644 compiler/moco-tf/src/CompilerArgs.test.cpp diff --git a/compiler/moco-tf/src/CompilerArgs.h b/compiler/moco-tf/src/CompilerArgs.h deleted file mode 100644 index 7529935..0000000 --- a/compiler/moco-tf/src/CompilerArgs.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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 __COMPILER_ARGS_H -#define __COMPILER_ARGS_H - -#include - -#include -#include - -namespace moco -{ -namespace tf -{ - -/** - * @brief Class that stores parsed arguments passed from command line interface. - * Command line parser should fill member vars of the instance of this class. - */ -class CompilerArgs final -{ -public: - /** - * @brief Adds graph input name and its shape provided from user - */ - void addInput(const std::string &input_name, const nncc::core::ADT::tensor::Shape &shape) - { - if (_inputs.find(input_name) != _inputs.end()) - throw std::runtime_error{"Duplicated input name: " + input_name}; - - _inputs[input_name] = shape; - } - - const nncc::core::ADT::tensor::Shape *getInputShape(const std::string &input_name) - { - auto res = _inputs.find(input_name); - if (res == _inputs.end()) - return nullptr; - else - return &res->second; - } - -public: - /** - * @brief function to get a singleton instance - */ - static CompilerArgs *get() - { - static CompilerArgs me; - return &me; - } - - /** - * @brief Clears all data. Only for testing purpose. - */ - void clear() { _inputs.clear(); } - -private: - CompilerArgs() = default; - -private: - // For command line argument input shapes and input names - std::map _inputs; - - // add more compiler arguments -}; - -} // namespace tf -} // namespace moco - -#endif // __COMPILER_ARGS_H diff --git a/compiler/moco-tf/src/CompilerArgs.test.cpp b/compiler/moco-tf/src/CompilerArgs.test.cpp deleted file mode 100644 index 1cf2150..0000000 --- a/compiler/moco-tf/src/CompilerArgs.test.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - -#include "CompilerArgs.h" - -#include - -#include - -TEST(CompilerArgs, inputShape_empty) -{ - auto args = moco::tf::CompilerArgs::get(); - - std::string any_name = "any"; - ASSERT_TRUE(args->getInputShape(any_name) == nullptr); -} diff --git a/compiler/moco-tf/src/Op/Add.test.cpp b/compiler/moco-tf/src/Op/Add.test.cpp index 134d5f6..dc53f37 100644 --- a/compiler/moco-tf/src/Op/Add.test.cpp +++ b/compiler/moco-tf/src/Op/Add.test.cpp @@ -15,7 +15,6 @@ */ #include "TestHelper.h" -#include "CompilerArgs.h" #include "Importer.h" diff --git a/compiler/moco-tf/src/Op/Mul.test.cpp b/compiler/moco-tf/src/Op/Mul.test.cpp index 7da1a67..7bc1386 100644 --- a/compiler/moco-tf/src/Op/Mul.test.cpp +++ b/compiler/moco-tf/src/Op/Mul.test.cpp @@ -15,7 +15,6 @@ */ #include "TestHelper.h" -#include "CompilerArgs.h" #include "Importer.h" diff --git a/compiler/moco-tf/src/Op/Placeholder.test.cpp b/compiler/moco-tf/src/Op/Placeholder.test.cpp index 963076c..0fe32af 100644 --- a/compiler/moco-tf/src/Op/Placeholder.test.cpp +++ b/compiler/moco-tf/src/Op/Placeholder.test.cpp @@ -15,7 +15,6 @@ */ #include "TestHelper.h" -#include "CompilerArgs.h" #include "Importer.h" -- 2.7.4