[exo-tflite] Placeholders for TFL nodes (#7021)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Thu, 29 Aug 2019 08:27:01 +0000 (17:27 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Thu, 29 Aug 2019 08:27:01 +0000 (17:27 +0900)
* [exo-tflite] Placeholders for TFL nodes

This will add TODO comment as placeholders for TFL nodes to come

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
* use name from schema

compiler/exo-tflite/src/Dialect/IR/TFLNodes.h
compiler/exo-tflite/src/Dialect/IR/TFLNodes.lst
compiler/exo-tflite/src/Dialect/IR/TFLNodes.test.cpp
compiler/exo-tflite/src/Knob.lst
compiler/exo-tflite/src/OperationExporter.cpp
compiler/exo-tflite/src/TFLExporterImpl.test.cpp
compiler/exo-tflite/src/TFLFormattedGraph.cpp

index 9754a3a..b902c81 100644 (file)
@@ -65,6 +65,22 @@ private:
   std::array<std::unique_ptr<loco::Use>, N> _args;
 };
 
+// TODO TFLAdd
+
+// TODO TFLAveragePool2D
+
+// TODO TFLConcatenation
+
+// TODO TFLConv2D
+
+// TODO TFLDepthwiseConv2D
+
+// TODO TFLDiv
+
+// TODO TFLMaxPool2D
+
+// TODO TFLMul
+
 class TFLRelu final : public FixedArityNode<1, TFLNodeImpl<TFLOpcode::RELU>>
 {
 public:
@@ -75,6 +91,20 @@ public:
   void input(loco::Node *node) { at(0)->node(node); }
 };
 
+// TODO TFLRelu6
+
+// TODO TFLReshape
+
+// TODO TFLSoftmax
+
+// TODO TFLSqrt
+
+// TODO TFLSub
+
+// TODO TFLTanh
+
+// TODO TFLTranspose
+
 // TODO define more children of TFLNode
 
 } // namespace locoex
index ec00838..ca13c0f 100644 (file)
@@ -6,8 +6,8 @@
 // PLEASE SORT NODE DECLS IN ALPHABETICAL ORDER
 //
 // TODO TFLAdd
-// TODO TFLAvgPool2D
-// TODO TFLConcat
+// TODO TFLAveragePool2D
+// TODO TFLConcatenation
 // TODO TFLConv2D
 // TODO TFLDepthwiseConv2D
 // TODO TFLDiv
index 9092068..90c98f3 100644 (file)
 
 #include <gtest/gtest.h>
 
+// TODO TFLAdd
+
+// TODO TFLAveragePool2D
+
+// TODO TFLConcatenation
+
+// TODO TFLConv2D
+
+// TODO TFLDepthwiseConv2D
+
+// TODO TFLDiv
+
+// TODO TFLMaxPool2D
+
+// TODO TFLMul
+
 TEST(TFLReluTest, constructor)
 {
   locoex::TFLRelu relu_node;
@@ -30,3 +46,17 @@ TEST(TFLReluTest, constructor)
 
   ASSERT_EQ(relu_node.input(), nullptr);
 }
+
+// TODO TFLRelu6
+
+// TODO TFLReshape
+
+// TODO TFLSoftmax
+
+// TODO TFLSqrt
+
+// TODO TFLSub
+
+// TODO TFLTanh
+
+// TODO TFLTranspose
index 45084d6..99f5ca4 100644 (file)
@@ -9,4 +9,19 @@
 KNOB_BOOL(EnableTFLDialect, false, Convert canonical nodes to TFLNodes)
 
 // operations
+// TODO TFLAdd
+// TODO TFLAveragePool2D
+// TODO TFLConcatenation
+// TODO TFLConv2D
+// TODO TFLDepthwiseConv2D
+// TODO TFLDiv
+// TODO TFLMaxPool2D
+// TODO TFLMul
 KNOB_BOOL(ConvertRelu, false, Convert loco::Relu to TFLRelu)
+// TODO TFLRelu6
+// TODO TFLReshape
+// TODO TFLSoftmax
+// TODO TFLSqrt
+// TODO TFLSub
+// TODO TFLTanh
+// TODO TFLTranspose
index f0108ec..91fa2f8 100644 (file)
@@ -45,7 +45,22 @@ public:
 
 public:
   // FOR TFLNodes
+  // TODO TFLAdd
+  // TODO TFLAveragePool2D
+  // TODO TFLConcatenation
+  // TODO TFLConv2D
+  // TODO TFLDepthwiseConv2D
+  // TODO TFLDiv
+  // TODO TFLMaxPool2D
+  // TODO TFLMul
   void visit(locoex::TFLRelu *) final;
+  // TODO TFLRelu6
+  // TODO TFLReshape
+  // TODO TFLSoftmax
+  // TODO TFLSqrt
+  // TODO TFLSub
+  // TODO TFLTanh
+  // TODO TFLTranspose
 
   // FOR canonical nodes. These will be removed later
   void visit(loco::ReLU *) final;
@@ -81,6 +96,22 @@ private:
   SerializedModelData &gd;
 };
 
+// TODO TFLAdd
+
+// TODO TFLAveragePool2D
+
+// TODO TFLConcatenation
+
+// TODO TFLConv2D
+
+// TODO TFLDepthwiseConv2D
+
+// TODO TFLDiv
+
+// TODO TFLMaxPool2D
+
+// TODO TFLMul
+
 void OperationExporter::visit(locoex::TFLRelu *node)
 {
   uint32_t op_idx = gd.registerBuiltinOpcode(tflite::BuiltinOperator_RELU);
@@ -92,6 +123,20 @@ void OperationExporter::visit(locoex::TFLRelu *node)
   gd._operators.push_back(op_offset);
 }
 
+// TODO TFLRelu6
+
+// TODO TFLReshape
+
+// TODO TFLSoftmax
+
+// TODO TFLSqrt
+
+// TODO TFLSub
+
+// TODO TFLTanh
+
+// TODO TFLTranspose
+
 void OperationExporter::visit(loco::ReLU *node)
 {
   uint32_t op_idx = gd.registerBuiltinOpcode(tflite::BuiltinOperator_RELU);
index 5c9d770..a35ef84 100644 (file)
@@ -78,6 +78,22 @@ template <> loco::FeatureDecode *TFLExporterImplTests::make_node(void)
 
 } // namespace
 
+// TODO TFLAdd
+
+// TODO TFLAveragePool2D
+
+// TODO TFLConcatenation
+
+// TODO TFLConv2D
+
+// TODO TFLDepthwiseConv2D
+
+// TODO TFLDiv
+
+// TODO TFLMaxPool2D
+
+// TODO TFLMul
+
 TEST_F(TFLExporterImplTests, Relu6)
 {
   auto pull = make_node<loco::Pull>();
@@ -111,6 +127,20 @@ TEST_F(TFLExporterImplTests, Relu6)
   SUCCEED();
 }
 
+// TODO TFLRelu6
+
+// TODO TFLReshape
+
+// TODO TFLSoftmax
+
+// TODO TFLSqrt
+
+// TODO TFLSub
+
+// TODO TFLTanh
+
+// TODO TFLTranspose
+
 /**
  * What happens when there is a mismatch between generation and execution order!?
  */
index d6b449d..65de38d 100644 (file)
@@ -90,6 +90,22 @@ bool TFLNodeSummaryBuilderBase::build(const loco::Node *node, locop::NodeSummary
   return false;
 }
 
+// TODO TFLAdd
+
+// TODO TFLAveragePool2D
+
+// TODO TFLConcatenation
+
+// TODO TFLConv2D
+
+// TODO TFLDepthwiseConv2D
+
+// TODO TFLDiv
+
+// TODO TFLMaxPool2D
+
+// TODO TFLMul
+
 bool TFLNodeSummaryBuilder::summary(const locoex::TFLRelu *node, locop::NodeSummary &s) const
 {
   s.opname("TFL.RELU");
@@ -98,6 +114,20 @@ bool TFLNodeSummaryBuilder::summary(const locoex::TFLRelu *node, locop::NodeSumm
   return true;
 }
 
+// TODO TFLRelu6
+
+// TODO TFLReshape
+
+// TODO TFLSoftmax
+
+// TODO TFLSqrt
+
+// TODO TFLSub
+
+// TODO TFLTanh
+
+// TODO TFLTranspose
+
 } // namespace
 
 namespace exo