From 9f6b712b39856c2cf8bf27c5426ad98635976900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=98=A4=ED=98=95=EC=84=9D/On-Device=20Lab=28SR=29/Staff?= =?UTF-8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Wed, 10 Apr 2019 16:21:19 +0900 Subject: Remove unused util function in cpu backend (#4971) Remove unused util function in cpu backend: type conversion to tflite internal type Signed-off-by: Hyeongseok Oh --- .../neurun/backend/cpu/kernel/OperationUtils.h | 73 ---------------------- 1 file changed, 73 deletions(-) diff --git a/runtimes/neurun/backend/cpu/kernel/OperationUtils.h b/runtimes/neurun/backend/cpu/kernel/OperationUtils.h index 95bc16db5..152724297 100644 --- a/runtimes/neurun/backend/cpu/kernel/OperationUtils.h +++ b/runtimes/neurun/backend/cpu/kernel/OperationUtils.h @@ -25,9 +25,6 @@ #include -#include "tensorflow/contrib/lite/c/builtin_op_data.h" -#include "tensorflow/contrib/lite/kernels/internal/types.h" -#include "tensorflow/contrib/lite/kernels/internal/tensor.h" #include "model/operand/Object.h" #include "model/operand/DataType.h" @@ -64,51 +61,6 @@ uint32_t getNumberOfElements(const Shape &shape); uint32_t getSizeOfDimension(const Shape &shape, uint32_t dimensionIdx); -inline ::tflite::Dims<4> convertShapeToDims(const Shape &shape) -{ - // nnAssert(shape.dimensions.size() <= 4); - ::tflite::Dims<4> dims; - // The dimensions are reversed in Dims<4>. - for (int i = 0; i < 4; ++i) - { - int src = static_cast(shape.dimensions.size()) - i - 1; - if (src >= 0) - { - dims.sizes[i] = static_cast(getSizeOfDimension(shape, src)); - } - else - { - dims.sizes[i] = 1; - } - } - dims.strides[0] = 1; - for (int i = 1; i < 4; i++) - { - dims.strides[i] = dims.strides[i - 1] * dims.sizes[i - 1]; - } - return dims; -} - -inline ::tflite::RuntimeShape convertShapeToTFLiteShape(const Shape &shape) -{ - std::vector raw_shape; - raw_shape.resize(4); - - for (uint32_t i = 0; i < 4; ++i) - { - if (i >= shape.dimensions.size()) - { - raw_shape[i] = 1; - } - else - { - raw_shape[i] = shape.dimensions[i]; - } - } - - return ::tflite::GetTensorShape(raw_shape); -} - inline nnfw::cker::Shape convertToExtendedCkerShape(const Shape &shape) { std::vector raw_shape; @@ -150,31 +102,6 @@ inline nnfw::cker::Shape convertShapeToCkerShape(const Shape &shape) return nnfw::cker::GetShape(raw_shape); } -inline TfLiteFusedActivation convertFusedActivation(FuseCode act) -{ - if (act == ANEURALNETWORKS_FUSED_NONE) - { - return kTfLiteActNone; - } - - if (act == ANEURALNETWORKS_FUSED_RELU) - { - return kTfLiteActRelu; - } - - if (act == ANEURALNETWORKS_FUSED_RELU1) - { - return kTfLiteActRelu1; - } - - if (act == ANEURALNETWORKS_FUSED_RELU6) - { - return kTfLiteActRelu6; - } - - return kTfLiteActNone; -} - bool QuantizeMultiplier(double double_multiplier, int32_t *quantized_multiplier, int *shift); __wur bool QuantizeMultiplierSmallerThanOne(double double_multiplier, int32_t *quantized_multiplier, -- cgit v1.2.3