Remove unused util function in cpu backend (#4971)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 10 Apr 2019 07:21:19 +0000 (16:21 +0900)
committer이춘석/On-Device Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Wed, 10 Apr 2019 07:21:19 +0000 (16:21 +0900)
Remove unused util function in cpu backend: type conversion to tflite internal type

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
runtimes/neurun/backend/cpu/kernel/OperationUtils.h

index 95bc16d..1527242 100644 (file)
@@ -25,9 +25,6 @@
 
 #include <cker/Shape.h>
 
-#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<int>(shape.dimensions.size()) - i - 1;
-    if (src >= 0)
-    {
-      dims.sizes[i] = static_cast<int>(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<int32_t> 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<int32_t> 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,