From 1c1dc1176921dd4c2d7ec59ac70467c05e8dc792 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: Thu, 11 Apr 2019 14:33:59 +0900 Subject: [PATCH] [moco] Add empty Identity and Placeholder (#3225) This will add two empty GraphBuilder class for Identity and Placeholder node Signed-off-by: SaeHie Park --- contrib/moco/lib/frontend/tf/src/Op/Identity.cpp | 44 ++++++++++++++++++++++ contrib/moco/lib/frontend/tf/src/Op/Identity.h | 43 +++++++++++++++++++++ .../moco/lib/frontend/tf/src/Op/Placeholder.cpp | 44 ++++++++++++++++++++++ contrib/moco/lib/frontend/tf/src/Op/Placeholder.h | 43 +++++++++++++++++++++ 4 files changed, 174 insertions(+) create mode 100644 contrib/moco/lib/frontend/tf/src/Op/Identity.cpp create mode 100644 contrib/moco/lib/frontend/tf/src/Op/Identity.h create mode 100644 contrib/moco/lib/frontend/tf/src/Op/Placeholder.cpp create mode 100644 contrib/moco/lib/frontend/tf/src/Op/Placeholder.h diff --git a/contrib/moco/lib/frontend/tf/src/Op/Identity.cpp b/contrib/moco/lib/frontend/tf/src/Op/Identity.cpp new file mode 100644 index 0000000..c5edfa4 --- /dev/null +++ b/contrib/moco/lib/frontend/tf/src/Op/Identity.cpp @@ -0,0 +1,44 @@ +/* + * 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 "Identity.h" + +#include "GraphBuilderContext.h" + +#include + +#include +#include + +namespace moco +{ +namespace tf +{ + +bool IdentityGraphBuilder::validate(const tensorflow::NodeDef &node) const { return true; } + +void IdentityGraphBuilder::build(const tensorflow::NodeDef &node, + GraphBuilderContext *context) const +{ + assert(context != nullptr); + + // TODO implement + + throw std::runtime_error{"IdentityGraphBuilder NYI"}; +} + +} // namespace tf +} // namespace moco diff --git a/contrib/moco/lib/frontend/tf/src/Op/Identity.h b/contrib/moco/lib/frontend/tf/src/Op/Identity.h new file mode 100644 index 0000000..0831aa9 --- /dev/null +++ b/contrib/moco/lib/frontend/tf/src/Op/Identity.h @@ -0,0 +1,43 @@ +/* + * 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 __OP_IDENTITY_H__ +#define __OP_IDENTITY_H__ + +#include "GraphBuilder.h" +#include "GraphBuilderContext.h" + +#include + +namespace moco +{ +namespace tf +{ + +/** + * @brief GraphBuilder for Identity node + */ +class IdentityGraphBuilder : public GraphBuilder +{ +public: + bool validate(const tensorflow::NodeDef &) const override; + void build(const tensorflow::NodeDef &, GraphBuilderContext *) const override; +}; + +} // namespace tf +} // namespace moco + +#endif // __OP_IDENTITY_H__ diff --git a/contrib/moco/lib/frontend/tf/src/Op/Placeholder.cpp b/contrib/moco/lib/frontend/tf/src/Op/Placeholder.cpp new file mode 100644 index 0000000..c6caf8f --- /dev/null +++ b/contrib/moco/lib/frontend/tf/src/Op/Placeholder.cpp @@ -0,0 +1,44 @@ +/* + * 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 "Placeholder.h" + +#include "GraphBuilderContext.h" + +#include + +#include +#include + +namespace moco +{ +namespace tf +{ + +bool PlaceholderGraphBuilder::validate(const tensorflow::NodeDef &node) const { return true; } + +void PlaceholderGraphBuilder::build(const tensorflow::NodeDef &node, + GraphBuilderContext *context) const +{ + assert(context != nullptr); + + // TODO implement + + throw std::runtime_error{"PlaceholderGraphBuilder NYI"}; +} + +} // namespace tf +} // namespace moco diff --git a/contrib/moco/lib/frontend/tf/src/Op/Placeholder.h b/contrib/moco/lib/frontend/tf/src/Op/Placeholder.h new file mode 100644 index 0000000..cd52a2c --- /dev/null +++ b/contrib/moco/lib/frontend/tf/src/Op/Placeholder.h @@ -0,0 +1,43 @@ +/* + * 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 __OP_PLACEHOLDER_H__ +#define __OP_PLACEHOLDER_H__ + +#include "GraphBuilder.h" +#include "GraphBuilderContext.h" + +#include + +namespace moco +{ +namespace tf +{ + +/** + * @brief GraphBuilder for Placeholder node + */ +class PlaceholderGraphBuilder : public GraphBuilder +{ +public: + bool validate(const tensorflow::NodeDef &) const override; + void build(const tensorflow::NodeDef &, GraphBuilderContext *) const override; +}; + +} // namespace tf +} // namespace moco + +#endif // __OP_PLACEHOLDER_H__ -- 2.7.4