diff options
Diffstat (limited to 'compiler/enco/frontend/tflite')
10 files changed, 21 insertions, 24 deletions
diff --git a/compiler/enco/frontend/tflite/CMakeLists.txt b/compiler/enco/frontend/tflite/CMakeLists.txt index 77159879e..995e66f81 100644 --- a/compiler/enco/frontend/tflite/CMakeLists.txt +++ b/compiler/enco/frontend/tflite/CMakeLists.txt @@ -1,4 +1,4 @@ -nnas_find_package(FlatBuffers QUIET) +nnas_find_package(FlatBuffers EXACT 2.0 QUIET) if(NOT FlatBuffers_FOUND) return() @@ -17,17 +17,15 @@ add_library(enco_tflite_frontend SHARED ${SOURCES}) target_include_directories(enco_tflite_frontend PRIVATE src) target_link_libraries(enco_tflite_frontend enco_intf_frontend) target_link_libraries(enco_tflite_frontend enco_intf_cmdline) -target_link_libraries(enco_tflite_frontend flatbuffers) target_link_libraries(enco_tflite_frontend enco_tflite_schema) -target_link_libraries(enco_tflite_frontend stdex) target_link_libraries(enco_tflite_frontend morph) target_link_libraries(enco_tflite_frontend cwrap) -nnas_find_package(GTest QUIET) - -if(NOT GTest_FOUND) +if(NOT ENABLE_TEST) return() -endif(NOT GTest_FOUND) +endif(NOT ENABLE_TEST) + +nnas_find_package(GTest QUIET) add_executable(enco_tflite_frontend_test ${TESTS}) target_include_directories(enco_tflite_frontend_test PRIVATE src) diff --git a/compiler/enco/frontend/tflite/src/Context.cpp b/compiler/enco/frontend/tflite/src/Context.cpp index ef030dc5d..588c3c44b 100644 --- a/compiler/enco/frontend/tflite/src/Context.cpp +++ b/compiler/enco/frontend/tflite/src/Context.cpp @@ -48,7 +48,7 @@ void TensorContext::prepare(const tflite::SubGraph *graph) } TflOpCodeContext::TflOpCodeContext( - const flatbuffers::Vector<flatbuffers::Offset<tflite::OperatorCode>> *opcodes) + const flatbuffers::Vector<flatbuffers::Offset<tflite::OperatorCode>> *opcodes) { for (const tflite::OperatorCode *opcode : *opcodes) { diff --git a/compiler/enco/frontend/tflite/src/Context.h b/compiler/enco/frontend/tflite/src/Context.h index f72385f9a..caeac4ab5 100644 --- a/compiler/enco/frontend/tflite/src/Context.h +++ b/compiler/enco/frontend/tflite/src/Context.h @@ -135,8 +135,8 @@ public: explicit GraphBuilderContext(coco::Module *m, coco::Data *d, coco::Block *block, TensorBags &tensor_bags, TensorContext &tensor_context, TflBufferContext &buffer_context, const tflite::SubGraph *graph) - : _m(m), _d(d), _block(block), _tensor_bags(tensor_bags), _tensor_context(tensor_context), - _buffer_context(buffer_context), _graph(graph) + : _m(m), _d(d), _block(block), _tensor_bags(tensor_bags), _tensor_context(tensor_context), + _buffer_context(buffer_context), _graph(graph) { // DO NOTHING } diff --git a/compiler/enco/frontend/tflite/src/Entry.cpp b/compiler/enco/frontend/tflite/src/Entry.cpp index c69e18074..74d3096ab 100644 --- a/compiler/enco/frontend/tflite/src/Entry.cpp +++ b/compiler/enco/frontend/tflite/src/Entry.cpp @@ -19,12 +19,11 @@ #include <cmdline/View.h> -#include <stdex/Memory.h> - +#include <memory> #include <fstream> #include <cassert> -using stdex::make_unique; +using std::make_unique; extern "C" std::unique_ptr<enco::Frontend> make_frontend(const cmdline::View &cmdline) { diff --git a/compiler/enco/frontend/tflite/src/Frontend.test.cpp b/compiler/enco/frontend/tflite/src/Frontend.test.cpp index aee6099e7..1bc774629 100644 --- a/compiler/enco/frontend/tflite/src/Frontend.test.cpp +++ b/compiler/enco/frontend/tflite/src/Frontend.test.cpp @@ -16,11 +16,11 @@ #include "Frontend.h" -#include <stdex/Memory.h> +#include <memory> #include <gtest/gtest.h> -using stdex::make_unique; +using std::make_unique; namespace { diff --git a/compiler/enco/frontend/tflite/src/GraphBuilderRegistry.h b/compiler/enco/frontend/tflite/src/GraphBuilderRegistry.h index 1ae882e89..ca4f74fc5 100644 --- a/compiler/enco/frontend/tflite/src/GraphBuilderRegistry.h +++ b/compiler/enco/frontend/tflite/src/GraphBuilderRegistry.h @@ -29,11 +29,11 @@ #include "Op/Div.h" #include <schema_generated.h> -#include <stdex/Memory.h> +#include <memory> #include <map> -using stdex::make_unique; +using std::make_unique; namespace tflimport { @@ -68,7 +68,7 @@ private: // add GraphBuilder for each tflite operation. _builder_map[tflite::BuiltinOperator_CONV_2D] = make_unique<Conv2DGraphBuilder>(); _builder_map[tflite::BuiltinOperator_DEPTHWISE_CONV_2D] = - make_unique<DepthwiseConv2DGraphBuilder>(); + make_unique<DepthwiseConv2DGraphBuilder>(); _builder_map[tflite::BuiltinOperator_AVERAGE_POOL_2D] = make_unique<AvgPool2DGraphBuilder>(); _builder_map[tflite::BuiltinOperator_MAX_POOL_2D] = make_unique<MaxPool2DGraphBuilder>(); _builder_map[tflite::BuiltinOperator_CONCATENATION] = make_unique<ConcatenationGraphBuilder>(); diff --git a/compiler/enco/frontend/tflite/src/Op/AveragePool2D.cpp b/compiler/enco/frontend/tflite/src/Op/AveragePool2D.cpp index 16f68fcdb..6f8223f10 100644 --- a/compiler/enco/frontend/tflite/src/Op/AveragePool2D.cpp +++ b/compiler/enco/frontend/tflite/src/Op/AveragePool2D.cpp @@ -102,7 +102,7 @@ void AvgPool2DGraphBuilder::build(const tflite::Operator *op, GraphBuilderContex coco_avgpool2d->stride()->horizontal(params->stride_w()); coco::Padding2D padding = - pool2D_padding(params, ifm_shape, params->filter_width(), params->filter_height()); + pool2D_padding(params, ifm_shape, params->filter_width(), params->filter_height()); coco_avgpool2d->pad()->top(padding.top()); coco_avgpool2d->pad()->bottom(padding.bottom()); diff --git a/compiler/enco/frontend/tflite/src/Op/Conv2D.cpp b/compiler/enco/frontend/tflite/src/Op/Conv2D.cpp index e9516c0e9..d1f97597f 100644 --- a/compiler/enco/frontend/tflite/src/Op/Conv2D.cpp +++ b/compiler/enco/frontend/tflite/src/Op/Conv2D.cpp @@ -171,7 +171,7 @@ void Conv2DGraphBuilder::build(const tflite::Operator *op, GraphBuilderContext * // fused activation coco::FeatureObject *act_output = - build_activation(conv_params->fused_activation_function(), blk, last_obj); + build_activation(conv_params->fused_activation_function(), blk, last_obj); // Create Copy Instr of last_obj to Output Object auto copy_ins = instr_builder(m).copy(ofm_obj, act_output); diff --git a/compiler/enco/frontend/tflite/src/Op/DepthwiseConv2D.cpp b/compiler/enco/frontend/tflite/src/Op/DepthwiseConv2D.cpp index e3d7b263e..bc903c380 100644 --- a/compiler/enco/frontend/tflite/src/Op/DepthwiseConv2D.cpp +++ b/compiler/enco/frontend/tflite/src/Op/DepthwiseConv2D.cpp @@ -138,8 +138,8 @@ void DepthwiseConv2DGraphBuilder::build(const tflite::Operator *op, auto wc = new_shape.width() * new_shape.depth(); ker_spn[n * hwc + h * wc + w * new_shape.depth() + c] = - buffer.ptr[tfl_n * hw * new_shape.count() + /* new_shape.count() is old c */ - h * new_shape.width() * new_shape.count() + w * new_shape.count() + tfl_c]; + buffer.ptr[tfl_n * hw * new_shape.count() + /* new_shape.count() is old c */ + h * new_shape.width() * new_shape.count() + w * new_shape.count() + tfl_c]; } } } @@ -220,7 +220,7 @@ void DepthwiseConv2DGraphBuilder::build(const tflite::Operator *op, // fused activation coco::FeatureObject *act_output = - build_activation(dconv_params->fused_activation_function(), blk, last_obj); + build_activation(dconv_params->fused_activation_function(), blk, last_obj); // Create Copy Instr of last_obj to Output Object auto copy_ins = instr_builder(m).copy(ofm_obj, act_output); diff --git a/compiler/enco/frontend/tflite/src/Op/MaxPool2D.cpp b/compiler/enco/frontend/tflite/src/Op/MaxPool2D.cpp index ee4406425..41e0cde17 100644 --- a/compiler/enco/frontend/tflite/src/Op/MaxPool2D.cpp +++ b/compiler/enco/frontend/tflite/src/Op/MaxPool2D.cpp @@ -99,7 +99,7 @@ void MaxPool2DGraphBuilder::build(const tflite::Operator *op, GraphBuilderContex coco_maxpool2d->stride()->horizontal(params->stride_w()); coco::Padding2D padding = - pool2D_padding(params, ifm_shape, params->filter_width(), params->filter_height()); + pool2D_padding(params, ifm_shape, params->filter_width(), params->filter_height()); coco_maxpool2d->pad()->top(padding.top()); coco_maxpool2d->pad()->bottom(padding.bottom()); |