diff options
author | 박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com> | 2019-09-16 15:46:45 +0900 |
---|---|---|
committer | GitHub Enterprise <noreply-CODE@samsung.com> | 2019-09-16 15:46:45 +0900 |
commit | a3e4563d6bc4a80e3dfc45ddf1e0af140d071fd3 (patch) | |
tree | c2233f99bb5346845261c597ae2a657600559cc9 /compiler | |
parent | 91125a06cc2038275d425eb9c053729211624128 (diff) | |
download | nnfw-a3e4563d6bc4a80e3dfc45ddf1e0af140d071fd3.tar.gz nnfw-a3e4563d6bc4a80e3dfc45ddf1e0af140d071fd3.tar.bz2 nnfw-a3e4563d6bc4a80e3dfc45ddf1e0af140d071fd3.zip |
[exo-tflite] Export for TFLMul (#7449)
This will add exporter for TFLMul node
Signed-off-by: SaeHie Park <saehie.park@samsung.com>
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/exo-tflite/src/OperationExporter.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/compiler/exo-tflite/src/OperationExporter.cpp b/compiler/exo-tflite/src/OperationExporter.cpp index 77062594b..6b3400362 100644 --- a/compiler/exo-tflite/src/OperationExporter.cpp +++ b/compiler/exo-tflite/src/OperationExporter.cpp @@ -54,7 +54,7 @@ public: // TODO TFLDepthwiseConv2D // TODO TFLDiv void visit(locoex::TFLMaxPool2D *) final; - // TODO TFLMul + void visit(locoex::TFLMul *) final; void visit(locoex::TFLRelu *) final; // TODO TFLRelu6 // TODO TFLReshape @@ -138,7 +138,18 @@ void OperationExporter::visit(locoex::TFLMaxPool2D *node) export_pool_2d<locoex::TFLMaxPool2D>(node, tflite::BuiltinOperator_MAX_POOL_2D); } -// TODO TFLMul +void OperationExporter::visit(locoex::TFLMul *node) +{ + uint32_t op_idx = gd.registerBuiltinOpcode(tflite::BuiltinOperator_MUL); + std::vector<int32_t> inputs_vec{get_tensor_index(node->x()), get_tensor_index(node->y())}; + std::vector<int32_t> outputs_vec{get_tensor_index(static_cast<loco::Node *>(node))}; + auto inputs = builder.CreateVector(inputs_vec); + auto outputs = builder.CreateVector(outputs_vec); + auto options = CreateAddOptions(builder); // dummy option + auto op_offset = CreateOperator(builder, op_idx, inputs, outputs, + tflite::BuiltinOptions_AddOptions, options.Union()); + gd._operators.push_back(op_offset); +} void OperationExporter::visit(locoex::TFLRelu *node) { |