From: Сергей Баранников/AI Tools Lab /SRR/Engineer/삼성전자 Date: Thu, 1 Aug 2019 10:26:11 +0000 (+0300) Subject: [mir] Fix number of outputs of `OutputOp` (#5993) X-Git-Tag: submit/tizen/20190809.050447~249 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=69b3bcf9859d6ffe4ff4b69149944638ab822b20;p=platform%2Fcore%2Fml%2Fnnfw.git [mir] Fix number of outputs of `OutputOp` (#5993) `OutputOp` is auxilary operation, which is used only to mark outputs of the Graph. It has one input and mistakenly had one output. Signed-off-by: Sergei Barannikov --- diff --git a/compiler/mir/include/mir/ops/OutputOp.h b/compiler/mir/include/mir/ops/OutputOp.h index 5f70740..4c44af8 100644 --- a/compiler/mir/include/mir/ops/OutputOp.h +++ b/compiler/mir/include/mir/ops/OutputOp.h @@ -27,7 +27,7 @@ namespace ops class OutputOp : public Operation { public: - explicit OutputOp(Output *input) : Operation(Type::output, {input}) {} + explicit OutputOp(Output *input) : Operation(Type::output, {input}, 0) {} Operation *copyWithInputs(const std::vector &inputs) override { diff --git a/compiler/mir2loco/src/mir2loco.test.cpp b/compiler/mir2loco/src/mir2loco.test.cpp index 82a344f..e2aa9cb 100644 --- a/compiler/mir2loco/src/mir2loco.test.cpp +++ b/compiler/mir2loco/src/mir2loco.test.cpp @@ -32,8 +32,7 @@ TEST_F(TestTransformer_mir2loco, Input_Output_Test) mir::Shape input_shape = mir::Shape({5, 6, 7, 8}); auto *input = mir_graph.create("input", input_shape); - auto *output = mir_graph.create("output", input->getOutput(0)); - output->getOutput(0)->setShape(input_shape); + mir_graph.create("output", input->getOutput(0)); mir2loco::Transformer transformer; auto loco_graph = transformer.transform(&mir_graph);