From: 박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 Date: Fri, 16 Aug 2019 03:41:45 +0000 (+0900) Subject: [exo-tflite] Enable EltwiseSqrt (#6610) X-Git-Tag: accepted/tizen/unified/20190903.052428~365 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d95095d7e95850139d521ac9ddfd4fd229759fc4;p=platform%2Fcore%2Fml%2Fnnfw.git [exo-tflite] Enable EltwiseSqrt (#6610) * [exo-tflite] Enable EltwiseSqrt This will enable export for EltwiseSqrt node Signed-off-by: SaeHie Park * remove for shapeinf * remove not related new line --- diff --git a/compiler/exo-tflite/src/OperationExporter.cpp b/compiler/exo-tflite/src/OperationExporter.cpp index 533d2a0..916179c 100644 --- a/compiler/exo-tflite/src/OperationExporter.cpp +++ b/compiler/exo-tflite/src/OperationExporter.cpp @@ -59,6 +59,7 @@ public: void visit(loco::EltwiseMul *) final; void visit(loco::EltwiseSub *) final; void visit(loco::EltwiseDiv *) final; + void visit(loco::EltwiseSqrt *) final; void visit(loco::FixedReshape *) final; void visit(locoex::COpCall *); @@ -427,6 +428,17 @@ void OperationExporter::visit(loco::EltwiseDiv *node) gd._operators.push_back(op_offset); } +void OperationExporter::visit(loco::EltwiseSqrt *node) +{ + uint32_t op_idx = gd.registerBuiltinOpcode(tflite::BuiltinOperator_SQRT); + std::vector inputs_vec{get_tensor_index(node->input())}; + std::vector outputs_vec{get_tensor_index(static_cast(node))}; + auto inputs = builder.CreateVector(inputs_vec); + auto outputs = builder.CreateVector(outputs_vec); + auto op_offset = CreateOperator(builder, op_idx, inputs, outputs); + gd._operators.push_back(op_offset); +} + void OperationExporter::visit(loco::FixedReshape *node) { std::vector new_shape_vec;