From 7e1433c2092c5ed3be340c26b9164b54561c4f30 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: Wed, 4 Sep 2019 18:51:50 +0900 Subject: [PATCH] [loco] Introducing BiasDecode (#7158) This introduce loco::BiasDecode, which translate Bias domain to Tensor domain. Signed-off-by: Hyun Sik Yoon --- compiler/loco/include/loco/IR/CanonicalNodes.lst | 1 + compiler/loco/include/loco/IR/Nodes.h | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/compiler/loco/include/loco/IR/CanonicalNodes.lst b/compiler/loco/include/loco/IR/CanonicalNodes.lst index 2acc259..2bd2cf0 100644 --- a/compiler/loco/include/loco/IR/CanonicalNodes.lst +++ b/compiler/loco/include/loco/IR/CanonicalNodes.lst @@ -8,6 +8,7 @@ // CANONICAL_NODE(OPCODE, CLASS) CANONICAL_NODE(AvgPool2D, AvgPool2D) +CANONICAL_NODE(BiasDecode, BiasDecode) CANONICAL_NODE(BiasEncode, BiasEncode) CANONICAL_NODE(ConstGen, ConstGen) CANONICAL_NODE(Conv2D, Conv2D) diff --git a/compiler/loco/include/loco/IR/Nodes.h b/compiler/loco/include/loco/IR/Nodes.h index 11bdc7a..813bfe2 100644 --- a/compiler/loco/include/loco/IR/Nodes.h +++ b/compiler/loco/include/loco/IR/Nodes.h @@ -593,6 +593,19 @@ private: using TensorSoftmax = Softmax; /** + * @brief Create a "Tensor" from a "Bias" + */ +class BiasDecode final : public CanonicalNodeDef::Mixin> +{ +public: + BiasDecode() = default; + +public: + Node *input(void) const { return at(0)->node(); } + void input(Node *node) { at(0)->node(node); } +}; + +/** * @brief Create a "Bias" from a "Tensor" * * BiasEncode currently requires a rank-1 tensor as its input. -- 2.7.4