From 87c1cb9bb7509ad1af6ce581c8a1bac024a633aa 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, 31 Oct 2019 16:47:27 +0900 Subject: [PATCH] [moco] Produce TFPush for graph output (#8647) * [moco] Produce TFPush for graph output This will update to produce TFPush for graph output node Signed-off-by: SaeHie Park * update comment --- compiler/moco/import/src/Importer.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/compiler/moco/import/src/Importer.cpp b/compiler/moco/import/src/Importer.cpp index 01ff8c8..d73472c 100644 --- a/compiler/moco/import/src/Importer.cpp +++ b/compiler/moco/import/src/Importer.cpp @@ -21,6 +21,7 @@ #include "moco/Import/GraphBuilderRegistry.h" #include +#include #include @@ -48,7 +49,7 @@ void convert_graph(const moco::GraphBuilderSource &source, const moco::ModelSign // 1. Convert all the nodes to loco::Node // 2. Connect inputs: set all node input(from a string) to actual node object // 3. Set graph input - // 4. Create loco::Push node and set input and set graph output + // 4. Create moco::TFPush node and set graph output /** * @brief Prepare tensorflow::NodeDef search table from name @@ -150,23 +151,24 @@ void convert_graph(const moco::GraphBuilderSource &source, const moco::ModelSign } /** - * @brief 4. Create loco::Push node and set graph input and output + * @brief 4. Create moco::TFPush node and set graph output */ for (auto output : signature.outputs()) { auto output_node = tensor_names->node(output); assert(output_node); - // create loco::Push for output of graph - auto push_node = graph->nodes()->create(); - push_node->from(output_node); // set input of Push to output node + // create moco::TFPush for output of graph + auto push_node = graph->nodes()->create(); + push_node->from(output_node); // set input of TFPush to output node // set the graph output name and node object auto graph_output = graph->outputs()->create(); graph_output->name(output.nodeName()); + push_node->index(graph_output->index()); + // TODO Support other types graph_output->dtype(loco::DataType::FLOAT32); - loco::link(graph_output, push_node); } // validate graph -- 2.7.4