From 80e49049dffaea5a0beba304571f8e6644895029 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: Mon, 1 Jul 2019 16:45:06 +0900 Subject: [PATCH] [moco/tf] Rename macro as CANONICAL_NODE (#4025) * [moco/tf] Rename macro as CANONICAL_NODE This will rename existing MOCONODE to CANONICAL_NODE as they are actually treating loco canonical nodes Signed-off-by: SaeHie Park * use canonical --- contrib/moco-tf/src/Transforms/CanonicalNodes.lst | 20 ++++++++++++++++++++ .../moco-tf/src/Transforms/FixPaddingTransform.cpp | 6 +++--- contrib/moco-tf/src/Transforms/FixShapeTransform.cpp | 6 +++--- contrib/moco-tf/src/Transforms/MocoNodes.lst | 20 -------------------- 4 files changed, 26 insertions(+), 26 deletions(-) create mode 100644 contrib/moco-tf/src/Transforms/CanonicalNodes.lst delete mode 100644 contrib/moco-tf/src/Transforms/MocoNodes.lst diff --git a/contrib/moco-tf/src/Transforms/CanonicalNodes.lst b/contrib/moco-tf/src/Transforms/CanonicalNodes.lst new file mode 100644 index 0000000..ee0c903 --- /dev/null +++ b/contrib/moco-tf/src/Transforms/CanonicalNodes.lst @@ -0,0 +1,20 @@ +#ifndef CANONICAL_NODE +#error Define CANONICAL_NODE first +#endif // CANONICAL_NODE + +// CANONICAL_NODE(Name) : alphabetic order please + +CANONICAL_NODE(AvgPool2D) +CANONICAL_NODE(BiasAdd) +CANONICAL_NODE(BiasEncode) +CANONICAL_NODE(ConstGen) +CANONICAL_NODE(Conv2D) +CANONICAL_NODE(FeatureDecode) +CANONICAL_NODE(FeatureEncode) +CANONICAL_NODE(FilterEncode) +CANONICAL_NODE(Forward) +CANONICAL_NODE(MaxPool2D) +CANONICAL_NODE(Pull) +CANONICAL_NODE(Push) +CANONICAL_NODE(ReLU) +CANONICAL_NODE(TensorConcat) diff --git a/contrib/moco-tf/src/Transforms/FixPaddingTransform.cpp b/contrib/moco-tf/src/Transforms/FixPaddingTransform.cpp index 3fab409..c786d64 100644 --- a/contrib/moco-tf/src/Transforms/FixPaddingTransform.cpp +++ b/contrib/moco-tf/src/Transforms/FixPaddingTransform.cpp @@ -324,15 +324,15 @@ bool FixPaddingTransform::run(loco::Graph *graph) for (auto node : loco::all_nodes(graph)) { // clang-format off -#define MOCONODE(TYPE_NAME) \ +#define CANONICAL_NODE(TYPE_NAME) \ if (as(node)) \ { \ if (fix_padding(as(node))) \ changed = true; \ } \ else -#include "MocoNodes.lst" -#undef MOCONODE +#include "CanonicalNodes.lst" +#undef CANONICAL_NODE // clang-format on { throw std::runtime_error("Not supported loco::Node type in FixPaddingTransform"); diff --git a/contrib/moco-tf/src/Transforms/FixShapeTransform.cpp b/contrib/moco-tf/src/Transforms/FixShapeTransform.cpp index 4278570..0b4be09 100644 --- a/contrib/moco-tf/src/Transforms/FixShapeTransform.cpp +++ b/contrib/moco-tf/src/Transforms/FixShapeTransform.cpp @@ -552,15 +552,15 @@ bool FixShapeTransform::run(loco::Graph *graph) for (auto node : loco::all_nodes(graph)) { // clang-format off -#define MOCONODE(TYPE_NAME) \ +#define CANONICAL_NODE(TYPE_NAME) \ if (as(node)) \ { \ if (fix_shape(as(node))) \ changed = true; \ } \ else -#include "MocoNodes.lst" -#undef MOCONODE +#include "CanonicalNodes.lst" +#undef CANONICAL_NODE // clang-format on { throw std::runtime_error("Not supported loco::Node type in FixShapeTransform"); diff --git a/contrib/moco-tf/src/Transforms/MocoNodes.lst b/contrib/moco-tf/src/Transforms/MocoNodes.lst deleted file mode 100644 index 536b771..0000000 --- a/contrib/moco-tf/src/Transforms/MocoNodes.lst +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef MOCONODE -#error Define MOCONODE first -#endif // MOCONODE - -// MOCONODE(Name) : alphabetic order please - -MOCONODE(AvgPool2D) -MOCONODE(BiasAdd) -MOCONODE(BiasEncode) -MOCONODE(ConstGen) -MOCONODE(Conv2D) -MOCONODE(FeatureDecode) -MOCONODE(FeatureEncode) -MOCONODE(FilterEncode) -MOCONODE(Forward) -MOCONODE(MaxPool2D) -MOCONODE(Pull) -MOCONODE(Push) -MOCONODE(ReLU) -MOCONODE(TensorConcat) -- 2.7.4