Browse Source

!4654 ReviewBotCheck

Merge pull request !4654 from gongdaguo/ReviewBotCheck
tags/v0.7.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
250ebbc96c
72 changed files with 39 additions and 98 deletions
  1. +0
    -1
      mindspore/lite/c_ops/deconv2d.cc
  2. +0
    -1
      mindspore/lite/c_ops/scatter_nd.cc
  3. +0
    -1
      mindspore/lite/c_ops/shape.cc
  4. +0
    -1
      mindspore/lite/src/common/file_utils.cc
  5. +0
    -1
      mindspore/lite/src/common/file_utils_ext.h
  6. +0
    -1
      mindspore/lite/src/common/graph_util.cc
  7. +1
    -3
      mindspore/lite/src/common/graph_util.h
  8. +0
    -1
      mindspore/lite/src/common/graph_utils_extends.cc
  9. +1
    -1
      mindspore/lite/src/common/log_adapter.cc
  10. +0
    -1
      mindspore/lite/src/ir/tensor.h
  11. +0
    -1
      mindspore/lite/src/lite_session.cc
  12. +0
    -3
      mindspore/lite/src/runtime/kernel/arm/fp16/matrix_fp16.cc
  13. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/split_fp16.c
  14. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/split_fp16.h
  15. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/int8/add_int8.c
  16. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/int8/mul_int8.c
  17. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pad.c
  18. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pad.h
  19. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/int8/slice_int8.c
  20. +2
    -2
      mindspore/lite/src/runtime/kernel/arm/nnacl/int8/slice_int8.h
  21. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/int8/sub_int8.c
  22. +3
    -3
      mindspore/lite/src/runtime/kernel/arm/nnacl/quantization/quantize.c
  23. +0
    -1
      mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_transform.c
  24. +0
    -1
      mindspore/lite/src/runtime/kernel/opencl/image_format.h
  25. +0
    -1
      mindspore/lite/src/runtime/kernel/opencl/utils.cc
  26. +0
    -1
      mindspore/lite/tools/anf_importer/anf_populater/anf_node_populater_registry.cc
  27. +0
    -1
      mindspore/lite/tools/common/graph_util.h
  28. +2
    -2
      mindspore/lite/tools/common/tensor_util.h
  29. +0
    -1
      mindspore/lite/tools/converter/legacy_optimizer/const_fold/add_const_fold_pass.cc
  30. +0
    -1
      mindspore/lite/tools/converter/legacy_optimizer/const_fold/concat_v2_const_fold_pass.cc
  31. +0
    -1
      mindspore/lite/tools/converter/legacy_optimizer/const_fold/rsqrt_const_fold_pass.cc
  32. +0
    -1
      mindspore/lite/tools/converter/legacy_optimizer/const_fold/sub_const_fold_pass.cc
  33. +0
    -1
      mindspore/lite/tools/converter/legacy_optimizer/const_fold/transpose_const_fold_pass.cc
  34. +0
    -2
      mindspore/lite/tools/converter/legacy_optimizer/fusion/format_trans_fusion_pass.cc
  35. +0
    -1
      mindspore/lite/tools/converter/legacy_optimizer/graph/eltwise_format_trans_pass.h
  36. +0
    -1
      mindspore/lite/tools/converter/legacy_optimizer/graph/format_trans_pass.cc
  37. +0
    -2
      mindspore/lite/tools/converter/parser/caffe/caffe_concat_parser.cc
  38. +0
    -1
      mindspore/lite/tools/converter/parser/caffe/caffe_crop_parser.cc
  39. +0
    -1
      mindspore/lite/tools/converter/parser/caffe/caffe_eltwise_parser.cc
  40. +1
    -1
      mindspore/lite/tools/converter/parser/caffe/caffe_flatten_parser.cc
  41. +0
    -1
      mindspore/lite/tools/converter/parser/caffe/caffe_interp_parser.cc
  42. +0
    -1
      mindspore/lite/tools/converter/parser/caffe/caffe_node_parser.h
  43. +3
    -3
      mindspore/lite/tools/converter/parser/caffe/caffe_permute_parser.cc
  44. +0
    -1
      mindspore/lite/tools/converter/parser/caffe/caffe_prelu_parser.cc
  45. +0
    -1
      mindspore/lite/tools/converter/parser/caffe/caffe_reshape_parser.cc
  46. +0
    -1
      mindspore/lite/tools/converter/parser/tflite/tflite_activation_parser.cc
  47. +0
    -2
      mindspore/lite/tools/converter/parser/tflite/tflite_activation_parser.h
  48. +0
    -1
      mindspore/lite/tools/converter/parser/tflite/tflite_arithmetic_parser.cc
  49. +0
    -2
      mindspore/lite/tools/converter/parser/tflite/tflite_arithmetic_parser.h
  50. +0
    -1
      mindspore/lite/tools/converter/parser/tflite/tflite_batch_to_space_parser.cc
  51. +0
    -1
      mindspore/lite/tools/converter/parser/tflite/tflite_batch_to_space_parser.h
  52. +0
    -2
      mindspore/lite/tools/converter/parser/tflite/tflite_depthwise_conv_parser.cc
  53. +1
    -1
      mindspore/lite/tools/converter/parser/tflite/tflite_fullyconnected_parser.cc
  54. +0
    -1
      mindspore/lite/tools/converter/parser/tflite/tflite_logical_parser.cc
  55. +0
    -1
      mindspore/lite/tools/converter/parser/tflite/tflite_logical_parser.h
  56. +1
    -1
      mindspore/lite/tools/converter/parser/tflite/tflite_pad_parser.cc
  57. +0
    -1
      mindspore/lite/tools/converter/parser/tflite/tflite_reduce_parser.cc
  58. +0
    -1
      mindspore/lite/tools/converter/parser/tflite/tflite_reduce_parser.h
  59. +1
    -1
      mindspore/lite/tools/converter/parser/tflite/tflite_reshape_parser.cc
  60. +3
    -3
      mindspore/lite/tools/converter/parser/tflite/tflite_resize_parser.cc
  61. +0
    -1
      mindspore/lite/tools/converter/parser/tflite/tflite_resize_parser.h
  62. +1
    -1
      mindspore/lite/tools/converter/parser/tflite/tflite_scatter_nd_parser.cc
  63. +4
    -5
      mindspore/lite/tools/converter/parser/tflite/tflite_util.cc
  64. +2
    -3
      mindspore/lite/tools/converter/quantizer/general_bitpacking.cc
  65. +0
    -1
      mindspore/lite/tools/converter/quantizer/post_training_quantizer.cc
  66. +0
    -2
      mindspore/lite/tools/converter/quantizer/quantize_util.h
  67. +0
    -1
      mindspore/lite/tools/converter/quantizer/weight_quantizer.cc
  68. +1
    -1
      mindspore/lite/tools/optimizer/common/gllo_utils.cc
  69. +1
    -1
      mindspore/lite/tools/optimizer/common/gllo_utils.h
  70. +2
    -2
      mindspore/lite/tools/optimizer/fusion/conv_activation_fusion.h
  71. +0
    -1
      mindspore/lite/tools/time_profile/time_profile.cc
  72. +0
    -1
      mindspore/lite/tools/time_profile/time_profile.h

+ 0
- 1
mindspore/lite/c_ops/deconv2d.cc View File

@@ -122,7 +122,6 @@ int DeConv2D::InferShape(std::vector<lite::tensor::Tensor *> inputs_, std::vecto
pad_d_ = GetPadDown(); pad_d_ = GetPadDown();
pad_r_ = GetPadRight(); pad_r_ = GetPadRight();
auto pad_mode = (schema::PadMode)GetPadMode(); auto pad_mode = (schema::PadMode)GetPadMode();

if (pad_mode == schema::PadMode_CAFFE) { if (pad_mode == schema::PadMode_CAFFE) {
output_h = (input_h - 1) * stride_h + ((kernel_h - 1) * dilate_h + 1) - pad_u_ - pad_d_; output_h = (input_h - 1) * stride_h + ((kernel_h - 1) * dilate_h + 1) - pad_u_ - pad_d_;
output_w = (input_w - 1) * stride_w + ((kernel_w - 1) * dilate_w + 1) - pad_l_ - pad_r_; output_w = (input_w - 1) * stride_w + ((kernel_w - 1) * dilate_w + 1) - pad_l_ - pad_r_;


+ 0
- 1
mindspore/lite/c_ops/scatter_nd.cc View File

@@ -58,5 +58,4 @@ int ScatterND::InferShape(std::vector<lite::tensor::Tensor *> inputs_, std::vect


return 0; return 0;
} }

} // namespace mindspore } // namespace mindspore

+ 0
- 1
mindspore/lite/c_ops/shape.cc View File

@@ -20,7 +20,6 @@ namespace mindspore {
namespace { namespace {
constexpr int kShapeInputNum = 1; constexpr int kShapeInputNum = 1;
constexpr int kShapeOutputNum = 1; constexpr int kShapeOutputNum = 1;

} // namespace } // namespace
int Shape::InferShape(std::vector<lite::tensor::Tensor *> inputs_, std::vector<lite::tensor::Tensor *> outputs_) { int Shape::InferShape(std::vector<lite::tensor::Tensor *> inputs_, std::vector<lite::tensor::Tensor *> outputs_) {
if (inputs_.size() != kShapeInputNum) { if (inputs_.size() != kShapeInputNum) {


+ 0
- 1
mindspore/lite/src/common/file_utils.cc View File

@@ -161,6 +161,5 @@ void CompareOutput(float *output_data, std::string file_path) {
// } // }
// return "/data/data/" + packageName + '/'; // return "/data/data/" + packageName + '/';
//} //}

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore

+ 0
- 1
mindspore/lite/src/common/file_utils_ext.h View File

@@ -22,7 +22,6 @@
namespace mindspore { namespace mindspore {
namespace lite { namespace lite {
int CompareRelativeOutput(float *output_data, std::string file_path); int CompareRelativeOutput(float *output_data, std::string file_path);

} }
} // namespace mindspore } // namespace mindspore
#endif // MINDSPORE_LITE_COMMON_FILE_UTILS_EXT_H_ #endif // MINDSPORE_LITE_COMMON_FILE_UTILS_EXT_H_

+ 0
- 1
mindspore/lite/src/common/graph_util.cc View File

@@ -75,7 +75,6 @@ std::vector<size_t> GetGraphOutputNodes(const schema::MetaGraph *meta_graph) {
// std::unordered_set<NODE_ID> OpNode::GetAllInEdges() { return inEdges; } // std::unordered_set<NODE_ID> OpNode::GetAllInEdges() { return inEdges; }
// //
// std::unordered_set<NODE_ID> OpNode::GetAllOutEdges() { return outEdges; } // std::unordered_set<NODE_ID> OpNode::GetAllOutEdges() { return outEdges; }

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore



+ 1
- 3
mindspore/lite/src/common/graph_util.h View File

@@ -82,7 +82,6 @@ int OpGraph<NODE_T>::Build(const schema::MetaGraph *subGraphDef) {
return RET_ERROR; return RET_ERROR;
} }



auto opDefs = subGraphDef->nodes(); auto opDefs = subGraphDef->nodes();


uint32_t opCount = opDefs->size(); uint32_t opCount = opDefs->size();
@@ -104,7 +103,7 @@ int OpGraph<NODE_T>::Build(const schema::MetaGraph *subGraphDef) {
} }
template <typename NODE_T> template <typename NODE_T>
int OpGraph<NODE_T>::AddEdge(const schema::CNode *srcNodeDef, int OpGraph<NODE_T>::AddEdge(const schema::CNode *srcNodeDef,
const flatbuffers::Vector<flatbuffers::Offset<schema::CNode>> *nodeDefs) {
const flatbuffers::Vector<flatbuffers::Offset<schema::CNode>> *nodeDefs) {
MS_ASSERT(srcNodeDef != nullptr); MS_ASSERT(srcNodeDef != nullptr);
MS_ASSERT(nodeDefs != nullptr); MS_ASSERT(nodeDefs != nullptr);
NODE_ID srcId = std::string(srcNodeDef->name()->c_str()); NODE_ID srcId = std::string(srcNodeDef->name()->c_str());
@@ -242,7 +241,6 @@ OpGraph<NODE_T>::~OpGraph() {
} }
nodes.clear(); nodes.clear();
} }

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore




+ 0
- 1
mindspore/lite/src/common/graph_utils_extends.cc View File

@@ -146,6 +146,5 @@ std::vector<AnfNodePtr> DeepUsedGraphSearch(const AnfNodePtr &root, const Includ
std::vector<AnfNodePtr> DeepLinkedGraphSearch(const AnfNodePtr &root, const IncludeFunc &include) { std::vector<AnfNodePtr> DeepLinkedGraphSearch(const AnfNodePtr &root, const IncludeFunc &include) {
return DeepLinkedGraphSearcher(include).Search(root); return DeepLinkedGraphSearcher(include).Search(root);
} }

} // namespace mindspore } // namespace mindspore



+ 1
- 1
mindspore/lite/src/common/log_adapter.cc View File

@@ -118,7 +118,7 @@ if (IsPrint(log_level_)) {
// #ifdef USE_ANDROID_LOG // #ifdef USE_ANDROID_LOG
#ifdef ENABLE_ARM #ifdef ENABLE_ARM
__android_log_print(GetAndroidLogLevel(log_level_), ANDROID_LOG_TAG, "[%s:%d] %s] %s", location_.file_, __android_log_print(GetAndroidLogLevel(log_level_), ANDROID_LOG_TAG, "[%s:%d] %s] %s", location_.file_,
location_.line_, location_.func_, msg.str().c_str());
location_.line_, location_.func_, msg.str().c_str());
#else #else
printf("%s [%s:%d] %s] %s\n:", EnumStrForMsLogLevel(log_level_), location_.file_, location_.line_, location_.func_, printf("%s [%s:%d] %s] %s\n:", EnumStrForMsLogLevel(log_level_), location_.file_, location_.line_, location_.func_,
msg.str().c_str()); msg.str().c_str());


+ 0
- 1
mindspore/lite/src/ir/tensor.h View File

@@ -29,7 +29,6 @@
namespace mindspore { namespace mindspore {
namespace lite { namespace lite {
namespace tensor { namespace tensor {

struct QuantArg { struct QuantArg {
double scale; double scale;
int32_t zeroPoint; int32_t zeroPoint;


+ 0
- 1
mindspore/lite/src/lite_session.cc View File

@@ -362,5 +362,4 @@ session::LiteSession *session::LiteSession::CreateSession(lite::Context *context
} }
return session; return session;
} }

} // namespace mindspore } // namespace mindspore

+ 0
- 3
mindspore/lite/src/runtime/kernel/arm/fp16/matrix_fp16.cc View File

@@ -33,7 +33,4 @@ void MatrixMultiplyFp16(const float16_t *matrix_a, const float16_t *matrix_b, fl
} }
} }
} }



} // namespace mindspore::kernel } // namespace mindspore::kernel

+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/split_fp16.c View File

@@ -20,7 +20,7 @@
#include "nnacl/errorcode.h" #include "nnacl/errorcode.h"


int DoSplitFp16(float16_t *in_data, float16_t **out_data, const int *input_shape, int offset, int num_unit, int DoSplitFp16(float16_t *in_data, float16_t **out_data, const int *input_shape, int offset, int num_unit,
SplitParameter *split_param) {
SplitParameter *split_param) {
if (in_data == NULL || out_data == NULL) { if (in_data == NULL || out_data == NULL) {
return NNACL_ERR; return NNACL_ERR;
} }


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/fp16/split_fp16.h View File

@@ -25,7 +25,7 @@
extern "C" { extern "C" {
#endif #endif
int DoSplitFp16(float16_t *in_data, float16_t **out_data, const int *input_shape, int offset, int num_unit, int DoSplitFp16(float16_t *in_data, float16_t **out_data, const int *input_shape, int offset, int num_unit,
SplitParameter *split_param);
SplitParameter *split_param);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/int8/add_int8.c View File

@@ -36,7 +36,7 @@ int32x4_t ClacScaledInput(int32x4_t input, int32x4_t left_shift_result_vec, int3
} }


int16x4_t AddClacSumHalfWord(int32x4_t scaled_input0, int32x4_t scaled_input1, int32x4_t left_shift_out_vec, int16x4_t AddClacSumHalfWord(int32x4_t scaled_input0, int32x4_t scaled_input1, int32x4_t left_shift_out_vec,
int32x4_t output_multiplier_vec, AddQuantParameter *para) {
int32x4_t output_multiplier_vec, AddQuantParameter *para) {
int32x4_t raw_sum = vaddq_s32(scaled_input0, scaled_input1); int32x4_t raw_sum = vaddq_s32(scaled_input0, scaled_input1);


raw_sum = RoundingDivideByPOTInt32x4(vqrdmulhq_s32(vmulq_s32(raw_sum, left_shift_out_vec), output_multiplier_vec), raw_sum = RoundingDivideByPOTInt32x4(vqrdmulhq_s32(vmulq_s32(raw_sum, left_shift_out_vec), output_multiplier_vec),


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/int8/mul_int8.c View File

@@ -25,7 +25,7 @@
#ifdef ENABLE_NEON #ifdef ENABLE_NEON


int16x4_t ClacSumHalfWordMul(int32x4_t scaled_input0, int32x4_t scaled_input1, int32x4_t left_shift_out_vec, int16x4_t ClacSumHalfWordMul(int32x4_t scaled_input0, int32x4_t scaled_input1, int32x4_t left_shift_out_vec,
int32x4_t output_multiplier_vec, MulQuantArg para) {
int32x4_t output_multiplier_vec, MulQuantArg para) {
int32x4_t input_scale = vmulq_s32(scaled_input0, scaled_input1); int32x4_t input_scale = vmulq_s32(scaled_input0, scaled_input1);
int32x4_t raw_sum = RoundingDivideByPOTInt32x4( int32x4_t raw_sum = RoundingDivideByPOTInt32x4(
SaturatingRoundingDoublingHighMulInt32x4(vmulq_s32(input_scale, left_shift_out_vec), output_multiplier_vec), SaturatingRoundingDoublingHighMulInt32x4(vmulq_s32(input_scale, left_shift_out_vec), output_multiplier_vec),


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pad.c View File

@@ -19,7 +19,7 @@
#include "nnacl/errorcode.h" #include "nnacl/errorcode.h"


int PadConstant4D(const int8_t *in_data, int8_t *out_data, const int32_t *in_dims, const int32_t *out_dims, int PadConstant4D(const int8_t *in_data, int8_t *out_data, const int32_t *in_dims, const int32_t *out_dims,
const int32_t *paddings, const int tid, const int thread_num) {
const int32_t *paddings, const int tid, const int thread_num) {
int32_t copy_size = in_dims[3]; int32_t copy_size = in_dims[3];
for (int n = 0; n < in_dims[0]; n++) { for (int n = 0; n < in_dims[0]; n++) {
for (int h = tid; h < in_dims[1]; h += thread_num) { for (int h = tid; h < in_dims[1]; h += thread_num) {


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/int8/pad.h View File

@@ -25,7 +25,7 @@
extern "C" { extern "C" {
#endif #endif
int PadConstant4D(const int8_t *in_data, int8_t *out_data, const int32_t *in_dims, const int32_t *out_dims, int PadConstant4D(const int8_t *in_data, int8_t *out_data, const int32_t *in_dims, const int32_t *out_dims,
const int32_t *paddings, const int tid, const int thread_num);
const int32_t *paddings, const int tid, const int thread_num);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/int8/slice_int8.c View File

@@ -99,9 +99,9 @@ int SliceInt8(const int8_t *input, int8_t *output, SliceParameter *param) {
multiplier = input_scale / output_scale; multiplier = input_scale / output_scale;
} }


for (n = 0; n< param->size_[0]; ++n) {
for (n = 0; n < param->size_[0]; ++n) {
size_t out_offset0 = n * out_stride0; size_t out_offset0 = n * out_stride0;
size_t in_offset0 = (n+ param->begin_[0]) * in_stride0 + param->begin_[3];
size_t in_offset0 = (n + param->begin_[0]) * in_stride0 + param->begin_[3];
for (h = 0; h < count_per_thread; ++h) { for (h = 0; h < count_per_thread; ++h) {
size_t k = h + thread_stride; size_t k = h + thread_stride;
if (k >= out_dim1) { if (k >= out_dim1) {


+ 2
- 2
mindspore/lite/src/runtime/kernel/arm/nnacl/int8/slice_int8.h View File

@@ -22,8 +22,8 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
int SliceInt8NoParallel(const int8_t*input, int8_t *output, SliceParameter *param);
int SliceInt8(const int8_t*input, int8_t *output, SliceParameter *param);
int SliceInt8NoParallel(const int8_t *input, int8_t *output, SliceParameter *param);
int SliceInt8(const int8_t *input, int8_t *output, SliceParameter *param);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/int8/sub_int8.c View File

@@ -24,7 +24,7 @@
#ifdef ENABLE_NEON #ifdef ENABLE_NEON


int16x4_t DoClacSumHalfWord(int32x4_t scaled_input0, int32x4_t scaled_input1, int32x4_t left_shift_out_vec, int16x4_t DoClacSumHalfWord(int32x4_t scaled_input0, int32x4_t scaled_input1, int32x4_t left_shift_out_vec,
int32x4_t output_multiplier_vec, SubQuantArg *para) {
int32x4_t output_multiplier_vec, SubQuantArg *para) {
int32x4_t raw_data = vsubq_s32(scaled_input0, scaled_input1); int32x4_t raw_data = vsubq_s32(scaled_input0, scaled_input1);


raw_data = RoundingDivideByPOTInt32x4(vqrdmulhq_s32(vmulq_s32(raw_data, left_shift_out_vec), output_multiplier_vec), raw_data = RoundingDivideByPOTInt32x4(vqrdmulhq_s32(vmulq_s32(raw_data, left_shift_out_vec), output_multiplier_vec),


+ 3
- 3
mindspore/lite/src/runtime/kernel/arm/nnacl/quantization/quantize.c View File

@@ -28,7 +28,7 @@ const int iMantissaBits = 31;




void QuantizeMultiplierSmallerThanOne(double double_multiplier, int32_t *quantized_multiplier, void QuantizeMultiplierSmallerThanOne(double double_multiplier, int32_t *quantized_multiplier,
int *right_shift) {
int *right_shift) {
if (quantized_multiplier == NULL || right_shift == NULL) { if (quantized_multiplier == NULL || right_shift == NULL) {
return; return;
} }
@@ -38,7 +38,7 @@ void QuantizeMultiplierSmallerThanOne(double double_multiplier, int32_t *quantiz
} }


void QuantizeRoundParameter(double double_multiplier, int32_t *quantized_multiplier, int *left_shift, void QuantizeRoundParameter(double double_multiplier, int32_t *quantized_multiplier, int *left_shift,
int *right_shift) {
int *right_shift) {
int shift; int shift;
QuantizeMultiplierSmallerThanOne(double_multiplier, quantized_multiplier, &shift); QuantizeMultiplierSmallerThanOne(double_multiplier, quantized_multiplier, &shift);
shift = -shift; shift = -shift;
@@ -56,7 +56,7 @@ uint8_t QuantizeToUint8(float real_value, float scale, int32_t zp) { return roun
int32_t QuantizeToInt8(float real_value, float scale, int32_t zp) { return round(real_value / scale + zp); } int32_t QuantizeToInt8(float real_value, float scale, int32_t zp) { return round(real_value / scale + zp); }


void CalculateActivationRangeQuantized(bool is_relu, bool is_relu6, int32_t zp, float scale, int *mini, void CalculateActivationRangeQuantized(bool is_relu, bool is_relu6, int32_t zp, float scale, int *mini,
int *maxi) {
int *maxi) {
int32_t min = CHAR_MIN; int32_t min = CHAR_MIN;
int32_t max = CHAR_MAX; int32_t max = CHAR_MAX;
int32_t quantized_zero = QuantizeToInt8(0, scale, zp); int32_t quantized_zero = QuantizeToInt8(0, scale, zp);


+ 0
- 1
mindspore/lite/src/runtime/kernel/arm/nnacl/winograd_transform.c View File

@@ -1364,7 +1364,6 @@ void Conv3x3Uint8OutputUnit(const int32_t *gemm_out, const int32_t *bias_data, i
} }
} }
} }

} else { } else {
for (int i = 0; i < C4NUM; i++) { for (int i = 0; i < C4NUM; i++) {
const int32_t *local_ptr = gemm_out + i; const int32_t *local_ptr = gemm_out + i;


+ 0
- 1
mindspore/lite/src/runtime/kernel/opencl/image_format.h View File

@@ -21,7 +21,6 @@


namespace mindspore { namespace mindspore {
namespace kernel { namespace kernel {

/** /**
* MindSpore to OpenCL channel order. * MindSpore to OpenCL channel order.
* @param num_channels * @param num_channels


+ 0
- 1
mindspore/lite/src/runtime/kernel/opencl/utils.cc View File

@@ -37,7 +37,6 @@ kernel::LiteKernel *GetOpenCLKernel(const std::vector<tensor::Tensor *> &in_tens


namespace mindspore { namespace mindspore {
namespace kernel { namespace kernel {

std::vector<size_t> GetCommonGlobalSize(const std::vector<size_t> &local, const std::vector<size_t> &global) { std::vector<size_t> GetCommonGlobalSize(const std::vector<size_t> &local, const std::vector<size_t> &global) {
std::vector<size_t> result(3, 1); std::vector<size_t> result(3, 1);
for (int i = 0; i < 3; ++i) { for (int i = 0; i < 3; ++i) {


+ 0
- 1
mindspore/lite/tools/anf_importer/anf_populater/anf_node_populater_registry.cc View File

@@ -31,6 +31,5 @@ AnfNodePopulater *AnfNodePopulaterRegistry::GetNodePopulater(const std::string &
void AnfNodePopulaterRegistry::SetNodePopulater(const std::string &name, AnfNodePopulater *populater) { void AnfNodePopulaterRegistry::SetNodePopulater(const std::string &name, AnfNodePopulater *populater) {
populaters[name] = populater; populaters[name] = populater;
} }

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore

+ 0
- 1
mindspore/lite/tools/common/graph_util.h View File

@@ -99,7 +99,6 @@ class OpGraphT : public OpGraph<OpNode> {
int AddEdge(NODE_ID srcId, NODE_ID dstId); int AddEdge(NODE_ID srcId, NODE_ID dstId);
int AddEdge(const schema::CNodeT *srcNodeDef, const std::vector<std::unique_ptr<schema::CNodeT>> *nodeDefs); int AddEdge(const schema::CNodeT *srcNodeDef, const std::vector<std::unique_ptr<schema::CNodeT>> *nodeDefs);
}; };

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore




+ 2
- 2
mindspore/lite/tools/common/tensor_util.h View File

@@ -55,8 +55,8 @@ size_t GetRefCount(schema::MetaGraphT *graphT, uint32_t tensorIdx);


std::unique_ptr<schema::QuantParamT> CopyQuantParamT(const std::unique_ptr<schema::QuantParamT> &srcQuantParam); std::unique_ptr<schema::QuantParamT> CopyQuantParamT(const std::unique_ptr<schema::QuantParamT> &srcQuantParam);


std::unique_ptr<schema::QuantParamT> \
CopyQuantParamArrayT(const std::unique_ptr<schema::QuantParamT> &srcQuantParamArray);
std::unique_ptr<schema::QuantParamT> CopyQuantParamArrayT(
const std::unique_ptr<schema::QuantParamT> &srcQuantParamArray);


std::unique_ptr<schema::QuantParamT> GetInTensorQuantParamArray(const schema::MetaGraphT &graphT, size_t tensorIdx); std::unique_ptr<schema::QuantParamT> GetInTensorQuantParamArray(const schema::MetaGraphT &graphT, size_t tensorIdx);




+ 0
- 1
mindspore/lite/tools/converter/legacy_optimizer/const_fold/add_const_fold_pass.cc View File

@@ -20,7 +20,6 @@


namespace mindspore { namespace mindspore {
namespace lite { namespace lite {

STATUS AddConstFoldPass::Run(GraphNode *graphNode) { return ConstFoldPass::Run(graphNode); } STATUS AddConstFoldPass::Run(GraphNode *graphNode) { return ConstFoldPass::Run(graphNode); }


STATUS AddConstFoldPass::CreateOp(SubGraphDefT *subGraph, OpDefT *node) { STATUS AddConstFoldPass::CreateOp(SubGraphDefT *subGraph, OpDefT *node) {


+ 0
- 1
mindspore/lite/tools/converter/legacy_optimizer/const_fold/concat_v2_const_fold_pass.cc View File

@@ -19,7 +19,6 @@


namespace mindspore { namespace mindspore {
namespace lite { namespace lite {

STATUS ConcatV2ConstFoldPass::Run(GraphNode *graphNode) { return ConstFoldPass::Run(graphNode); } STATUS ConcatV2ConstFoldPass::Run(GraphNode *graphNode) { return ConstFoldPass::Run(graphNode); }


STATUS ConcatV2ConstFoldPass::CreateOp(SubGraphDefT *subGraph, OpDefT *node) { STATUS ConcatV2ConstFoldPass::CreateOp(SubGraphDefT *subGraph, OpDefT *node) {


+ 0
- 1
mindspore/lite/tools/converter/legacy_optimizer/const_fold/rsqrt_const_fold_pass.cc View File

@@ -20,7 +20,6 @@


namespace mindspore { namespace mindspore {
namespace lite { namespace lite {

STATUS RsqrtConstFoldPass::Run(GraphNode *graphNode) { return ConstFoldPass::Run(graphNode); } STATUS RsqrtConstFoldPass::Run(GraphNode *graphNode) { return ConstFoldPass::Run(graphNode); }


STATUS RsqrtConstFoldPass::CreateOp(SubGraphDefT *subGraph, OpDefT *node) { STATUS RsqrtConstFoldPass::CreateOp(SubGraphDefT *subGraph, OpDefT *node) {


+ 0
- 1
mindspore/lite/tools/converter/legacy_optimizer/const_fold/sub_const_fold_pass.cc View File

@@ -23,7 +23,6 @@


namespace mindspore { namespace mindspore {
namespace lite { namespace lite {

STATUS SubConstFoldPass::Run(GraphNode *graphNode) { return ConstFoldPass::Run(graphNode); } STATUS SubConstFoldPass::Run(GraphNode *graphNode) { return ConstFoldPass::Run(graphNode); }


STATUS SubConstFoldPass::CreateOp(SubGraphDefT *subGraph, OpDefT *node) { STATUS SubConstFoldPass::CreateOp(SubGraphDefT *subGraph, OpDefT *node) {


+ 0
- 1
mindspore/lite/tools/converter/legacy_optimizer/const_fold/transpose_const_fold_pass.cc View File

@@ -20,7 +20,6 @@


namespace mindspore { namespace mindspore {
namespace lite { namespace lite {

STATUS TransposeConstFoldPass::Run(GraphNode *graphNode) { return ConstFoldPass::Run(graphNode); } STATUS TransposeConstFoldPass::Run(GraphNode *graphNode) { return ConstFoldPass::Run(graphNode); }


STATUS TransposeConstFoldPass::CreateOp(SubGraphDefT *subGraph, OpDefT *node) { STATUS TransposeConstFoldPass::CreateOp(SubGraphDefT *subGraph, OpDefT *node) {


+ 0
- 2
mindspore/lite/tools/converter/legacy_optimizer/fusion/format_trans_fusion_pass.cc View File

@@ -187,5 +187,3 @@ STATUS FormatTransFusionPass::DoFusion(schema::MetaGraphT *graph, const std::str
} }
} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore



+ 0
- 1
mindspore/lite/tools/converter/legacy_optimizer/graph/eltwise_format_trans_pass.h View File

@@ -24,7 +24,6 @@


namespace mindspore { namespace mindspore {
namespace lite { namespace lite {

class EltwiseFormatTransPass : public FormatTransPass { class EltwiseFormatTransPass : public FormatTransPass {
public: public:
EltwiseFormatTransPass() : FormatTransPass() {} EltwiseFormatTransPass() : FormatTransPass() {}


+ 0
- 1
mindspore/lite/tools/converter/legacy_optimizer/graph/format_trans_pass.cc View File

@@ -200,6 +200,5 @@ NodeIter FormatTransPass::InsertFormatTransNode(schema::MetaGraphT *graph, NodeI
void FormatTransPass::SetQuantType(QuantType quantType) { this->quantType = quantType; } void FormatTransPass::SetQuantType(QuantType quantType) { this->quantType = quantType; }


void FormatTransPass::SetFmk(converter::FmkType fmkType) { this->fmkType = fmkType; } void FormatTransPass::SetFmk(converter::FmkType fmkType) { this->fmkType = fmkType; }

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore

+ 0
- 2
mindspore/lite/tools/converter/parser/caffe/caffe_concat_parser.cc View File

@@ -28,7 +28,6 @@ STATUS CaffeConcatParser::Parse(const caffe::LayerParameter &proto,
op->name = proto.name(); op->name = proto.name();
std::unique_ptr<schema::ConcatT> attr(new schema::ConcatT()); std::unique_ptr<schema::ConcatT> attr(new schema::ConcatT());
const caffe::ConcatParameter concatParam = proto.concat_param(); const caffe::ConcatParameter concatParam = proto.concat_param();

if (concatParam.has_axis() && concatParam.has_concat_dim()) { if (concatParam.has_axis() && concatParam.has_concat_dim()) {
// MS_LOGE("Concat param in caffe have concat_dim and axis simultaneously,return fail"); // MS_LOGE("Concat param in caffe have concat_dim and axis simultaneously,return fail");
return RET_ERROR; return RET_ERROR;
@@ -37,7 +36,6 @@ STATUS CaffeConcatParser::Parse(const caffe::LayerParameter &proto,
if (concatParam.has_concat_dim()) { if (concatParam.has_concat_dim()) {
// MS_LOGD("Concat dim , set axis:%d", concatParam.concat_dim()); // MS_LOGD("Concat dim , set axis:%d", concatParam.concat_dim());
int32_t concat_dim_value = (int32_t)concatParam.concat_dim(); int32_t concat_dim_value = (int32_t)concatParam.concat_dim();

if (concat_dim_value < 0) { if (concat_dim_value < 0) {
// MS_LOGE("concat_dim value in model is smaller than 0:%d", concat_dim_value); // MS_LOGE("concat_dim value in model is smaller than 0:%d", concat_dim_value);
return RET_ERROR; return RET_ERROR;


+ 0
- 1
mindspore/lite/tools/converter/parser/caffe/caffe_crop_parser.cc View File

@@ -32,7 +32,6 @@ STATUS CaffeCropParser::Parse(const caffe::LayerParameter &proto,
attr->offsets = offsets; attr->offsets = offsets;
} else { } else {
const caffe::CropParameter cropParam = proto.crop_param(); const caffe::CropParameter cropParam = proto.crop_param();

if (cropParam.has_axis()) { if (cropParam.has_axis()) {
if (cropParam.axis() == -1) { if (cropParam.axis() == -1) {
// MS_LOGW("axis with -1 may lead to calculation errors when input less than 4 dims."); // MS_LOGW("axis with -1 may lead to calculation errors when input less than 4 dims.");


+ 0
- 1
mindspore/lite/tools/converter/parser/caffe/caffe_eltwise_parser.cc View File

@@ -34,7 +34,6 @@ STATUS CaffeEltwiseParser::Parse(const caffe::LayerParameter &proto, const caffe
} }


const caffe::EltwiseParameter eltwiseParam = proto.eltwise_param(); const caffe::EltwiseParameter eltwiseParam = proto.eltwise_param();

if (eltwiseParam.coeff_size() != 0 && eltwiseParam.coeff_size() != proto.bottom_size()) { if (eltwiseParam.coeff_size() != 0 && eltwiseParam.coeff_size() != proto.bottom_size()) {
MS_LOG(ERROR) << "Coeff size(" << eltwiseParam.coeff_size() MS_LOG(ERROR) << "Coeff size(" << eltwiseParam.coeff_size()
<< ") check fail, Eltwise Layer takes one coefficient per bottom blob."; << ") check fail, Eltwise Layer takes one coefficient per bottom blob.";


+ 1
- 1
mindspore/lite/tools/converter/parser/caffe/caffe_flatten_parser.cc View File

@@ -19,7 +19,7 @@
namespace mindspore { namespace mindspore {
namespace lite { namespace lite {
STATUS CaffeFlattenParser::Parse(const caffe::LayerParameter &proto, const caffe::LayerParameter &weight, STATUS CaffeFlattenParser::Parse(const caffe::LayerParameter &proto, const caffe::LayerParameter &weight,
schema::CNodeT *op, std::vector<schema::TensorT *> *weightVec) {
schema::CNodeT *op, std::vector<schema::TensorT *> *weightVec) {
if (op == nullptr) { if (op == nullptr) {
// MS_LOG(ERROR) << "null pointer dereferencing."; // MS_LOG(ERROR) << "null pointer dereferencing.";
return RET_NULL_PTR; return RET_NULL_PTR;


+ 0
- 1
mindspore/lite/tools/converter/parser/caffe/caffe_interp_parser.cc View File

@@ -23,7 +23,6 @@ STATUS CaffeInterpParser::Parse(const caffe::LayerParameter &proto, const caffe:
schema::CNodeT *op, std::vector<schema::TensorT *> *weightVec) { schema::CNodeT *op, std::vector<schema::TensorT *> *weightVec) {
std::unique_ptr<schema::ResizeT> attr(new schema::ResizeT()); std::unique_ptr<schema::ResizeT> attr(new schema::ResizeT());
const caffe::InterpParameter interpParam = proto.interp_param(); const caffe::InterpParameter interpParam = proto.interp_param();

if (interpParam.has_height()) { if (interpParam.has_height()) {
int64_t height = interpParam.height(); int64_t height = interpParam.height();
if (height < 0) { if (height < 0) {


+ 0
- 1
mindspore/lite/tools/converter/parser/caffe/caffe_node_parser.h View File

@@ -27,7 +27,6 @@


namespace mindspore { namespace mindspore {
namespace lite { namespace lite {

class CaffeNodeParser { class CaffeNodeParser {
public: public:
explicit CaffeNodeParser(const std::string &nodeName) : name(nodeName) {} explicit CaffeNodeParser(const std::string &nodeName) : name(nodeName) {}


+ 3
- 3
mindspore/lite/tools/converter/parser/caffe/caffe_permute_parser.cc View File

@@ -20,9 +20,9 @@
namespace mindspore { namespace mindspore {
namespace lite { namespace lite {
STATUS CaffePermuteParser::Parse(const caffe::LayerParameter &proto, STATUS CaffePermuteParser::Parse(const caffe::LayerParameter &proto,
const caffe::LayerParameter &weight,
schema::CNodeT *op,
std::vector<schema::TensorT *> *weightVec) {
const caffe::LayerParameter &weight,
schema::CNodeT *op,
std::vector<schema::TensorT *> *weightVec) {
op->name = proto.name(); op->name = proto.name();
std::unique_ptr<schema::TransposeT> attr(new schema::TransposeT()); std::unique_ptr<schema::TransposeT> attr(new schema::TransposeT());
const caffe::PermuteParameter permuteParam = proto.permute_param(); const caffe::PermuteParameter permuteParam = proto.permute_param();


+ 0
- 1
mindspore/lite/tools/converter/parser/caffe/caffe_prelu_parser.cc View File

@@ -25,7 +25,6 @@ STATUS CaffePReluParser::Parse(const caffe::LayerParameter &proto,
std::vector<schema::TensorT *> *weightVec) { std::vector<schema::TensorT *> *weightVec) {
std::unique_ptr<schema::CaffePReLUT> attr(new schema::CaffePReLUT()); std::unique_ptr<schema::CaffePReLUT> attr(new schema::CaffePReLUT());
const caffe::PReLUParameter pReluParam = proto.prelu_param(); const caffe::PReLUParameter pReluParam = proto.prelu_param();

if (pReluParam.has_channel_shared()) { if (pReluParam.has_channel_shared()) {
attr->channelShared = pReluParam.channel_shared(); attr->channelShared = pReluParam.channel_shared();
} else { } else {


+ 0
- 1
mindspore/lite/tools/converter/parser/caffe/caffe_reshape_parser.cc View File

@@ -27,7 +27,6 @@ STATUS CaffeReshapeParser::Parse(const caffe::LayerParameter &proto,
attr->format = schema::Format_NCHW; attr->format = schema::Format_NCHW;


const caffe::ReshapeParameter reshapeParam = proto.reshape_param(); const caffe::ReshapeParameter reshapeParam = proto.reshape_param();

if (!reshapeParam.has_shape()) { if (!reshapeParam.has_shape()) {
// MS_LOGE("Reshape has no shape info, ret fail"); // MS_LOGE("Reshape has no shape info, ret fail");
return RET_ERROR; return RET_ERROR;


+ 0
- 1
mindspore/lite/tools/converter/parser/tflite/tflite_activation_parser.cc View File

@@ -150,6 +150,5 @@ TfliteNodeRegister g_TfliteHardSwishParser("HardSwish", new TfliteHardSwishParse
TfliteNodeRegister g_tfliteLogisticParser("Logistic", new TfliteLogisticParser()); TfliteNodeRegister g_tfliteLogisticParser("Logistic", new TfliteLogisticParser());
TfliteNodeRegister g_tflitePreluParser("Prelu", new TflitePreluParser()); TfliteNodeRegister g_tflitePreluParser("Prelu", new TflitePreluParser());
TfliteNodeRegister g_TfliteLeakyReluParser("LeakyRelu", new TfliteLeakyReluParser()); TfliteNodeRegister g_TfliteLeakyReluParser("LeakyRelu", new TfliteLeakyReluParser());

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore

+ 0
- 2
mindspore/lite/tools/converter/parser/tflite/tflite_activation_parser.h View File

@@ -25,7 +25,6 @@


namespace mindspore { namespace mindspore {
namespace lite { namespace lite {

class TfliteActivationParser : public TfliteNodeParser { class TfliteActivationParser : public TfliteNodeParser {
public: public:
TfliteActivationParser() : TfliteNodeParser("node_name") {} TfliteActivationParser() : TfliteNodeParser("node_name") {}
@@ -89,7 +88,6 @@ class TfliteLeakyReluParser : public TfliteNodeParser {
std::vector<schema::Format> *tensors_format, std::vector<schema::Format> *tensors_format,
std::map<int, int> *tensors_id_map) override; std::map<int, int> *tensors_id_map) override;
}; };

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore




+ 0
- 1
mindspore/lite/tools/converter/parser/tflite/tflite_arithmetic_parser.cc View File

@@ -311,7 +311,6 @@ TfliteNodeRegister g_tfliteGreaterEParser("Greater", new TfliteGreaterParser());
TfliteNodeRegister g_tfliteGreaterEqualParser("GreaterEqual", new TfliteGreaterEqualParser()); TfliteNodeRegister g_tfliteGreaterEqualParser("GreaterEqual", new TfliteGreaterEqualParser());
TfliteNodeRegister g_tfliteLessParser("Less", new TfliteLessParser()); TfliteNodeRegister g_tfliteLessParser("Less", new TfliteLessParser());
TfliteNodeRegister g_tfliteLessEqualParser("LessEqual", new TfliteLessEqualParser()); TfliteNodeRegister g_tfliteLessEqualParser("LessEqual", new TfliteLessEqualParser());

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore




+ 0
- 2
mindspore/lite/tools/converter/parser/tflite/tflite_arithmetic_parser.h View File

@@ -25,7 +25,6 @@


namespace mindspore { namespace mindspore {
namespace lite { namespace lite {

class TfliteDoubleInputOpParser : public TfliteNodeParser { class TfliteDoubleInputOpParser : public TfliteNodeParser {
public: public:
TfliteDoubleInputOpParser() : TfliteNodeParser("node_name") {} TfliteDoubleInputOpParser() : TfliteNodeParser("node_name") {}
@@ -206,7 +205,6 @@ class TfliteLessEqualParser : public TfliteCompareOpParser {
public: public:
TfliteLessEqualParser() : TfliteCompareOpParser() {} TfliteLessEqualParser() : TfliteCompareOpParser() {}
}; };

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore




+ 0
- 1
mindspore/lite/tools/converter/parser/tflite/tflite_batch_to_space_parser.cc View File

@@ -72,6 +72,5 @@ STATUS TfliteBatchToSpaceParser::Parse(const std::unique_ptr<tflite::OperatorT>


TfliteNodeRegister g_tfliteBatchToSpaceParser("BatchToSpace", new TfliteBatchToSpaceParser()); TfliteNodeRegister g_tfliteBatchToSpaceParser("BatchToSpace", new TfliteBatchToSpaceParser());
TfliteNodeRegister g_TfliteBatchToSpaceNDParser("BatchToSpaceND", new TfliteBatchToSpaceNDParser()); TfliteNodeRegister g_TfliteBatchToSpaceNDParser("BatchToSpaceND", new TfliteBatchToSpaceNDParser());

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore

+ 0
- 1
mindspore/lite/tools/converter/parser/tflite/tflite_batch_to_space_parser.h View File

@@ -42,7 +42,6 @@ class TfliteBatchToSpaceNDParser : public TfliteBatchToSpaceParser {
public: public:
TfliteBatchToSpaceNDParser() : TfliteBatchToSpaceParser() {} TfliteBatchToSpaceNDParser() : TfliteBatchToSpaceParser() {}
}; };

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore




+ 0
- 2
mindspore/lite/tools/converter/parser/tflite/tflite_depthwise_conv_parser.cc View File

@@ -22,8 +22,6 @@


namespace mindspore { namespace mindspore {
namespace lite { namespace lite {


STATUS TfliteDepthwiseConv2DParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op, STATUS TfliteDepthwiseConv2DParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflite_op,
const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors, const std::vector<std::unique_ptr<tflite::TensorT>> &tflite_tensors,
const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer, const std::vector<std::unique_ptr<tflite::BufferT>> &tflite_model_buffer,


+ 1
- 1
mindspore/lite/tools/converter/parser/tflite/tflite_fullyconnected_parser.cc View File

@@ -68,7 +68,7 @@ STATUS TfliteFullyConnectedParser::Parse(const std::unique_ptr<tflite::OperatorT
AddOpInput(op, tensors_id, tensors_format, tensors_id_map, AddOpInput(op, tensors_id, tensors_format, tensors_id_map,
tflite_op->inputs[1], tensors_id->size(), tflite_tensors.size(), schema::Format_KHWC); tflite_op->inputs[1], tensors_id->size(), tflite_tensors.size(), schema::Format_KHWC);
AddOpInput(op, tensors_id, tensors_format, tensors_id_map, AddOpInput(op, tensors_id, tensors_format, tensors_id_map,
tflite_op->inputs[2], tensors_id->size(), tflite_tensors.size(), schema::Format_NHWC);
tflite_op->inputs[2], tensors_id->size(), tflite_tensors.size(), schema::Format_NHWC);
AddOpOutput(op, tensors_id, tensors_format, tensors_id_map, AddOpOutput(op, tensors_id, tensors_format, tensors_id_map,
tflite_op->outputs[0], tensors_id->size(), tflite_tensors.size(), schema::Format_NHWC); tflite_op->outputs[0], tensors_id->size(), tflite_tensors.size(), schema::Format_NHWC);
return RET_OK; return RET_OK;


+ 0
- 1
mindspore/lite/tools/converter/parser/tflite/tflite_logical_parser.cc View File

@@ -71,6 +71,5 @@ STATUS TfliteLogicalParser::Parse(const std::unique_ptr<tflite::OperatorT> &tfli
TfliteNodeRegister g_TfliteLogicalAndParser("LogicalAnd", new TfliteLogicalAndParser()); TfliteNodeRegister g_TfliteLogicalAndParser("LogicalAnd", new TfliteLogicalAndParser());
TfliteNodeRegister g_TfliteLogicalNotParser("LogicalNot", new TfliteLogicalNotParser()); TfliteNodeRegister g_TfliteLogicalNotParser("LogicalNot", new TfliteLogicalNotParser());
TfliteNodeRegister g_TfliteLogicalOrParser("LogicalOr", new TfliteLogicalOrParser()); TfliteNodeRegister g_TfliteLogicalOrParser("LogicalOr", new TfliteLogicalOrParser());

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore

+ 0
- 1
mindspore/lite/tools/converter/parser/tflite/tflite_logical_parser.h View File

@@ -25,7 +25,6 @@


namespace mindspore { namespace mindspore {
namespace lite { namespace lite {

class TfliteLogicalParser : public TfliteNodeParser { class TfliteLogicalParser : public TfliteNodeParser {
public: public:
TfliteLogicalParser() : TfliteNodeParser("node_name") {} TfliteLogicalParser() : TfliteNodeParser("node_name") {}


+ 1
- 1
mindspore/lite/tools/converter/parser/tflite/tflite_pad_parser.cc View File

@@ -59,7 +59,7 @@ STATUS TflitePadParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflite_o
op->primitive->value.value = attr.release(); op->primitive->value.value = attr.release();


AddOpInput(op, tensors_id, tensors_format, tensors_id_map, AddOpInput(op, tensors_id, tensors_format, tensors_id_map,
tflite_op->inputs[0], tensors_id->size(), tflite_tensors.size(), schema::Format_NHWC);
tflite_op->inputs[0], tensors_id->size(), tflite_tensors.size(), schema::Format_NHWC);
AddOpOutput(op, tensors_id, tensors_format, tensors_id_map, AddOpOutput(op, tensors_id, tensors_format, tensors_id_map,
tflite_op->outputs[0], tensors_id->size(), tflite_tensors.size(), schema::Format_NHWC); tflite_op->outputs[0], tensors_id->size(), tflite_tensors.size(), schema::Format_NHWC);
return RET_OK; return RET_OK;


+ 0
- 1
mindspore/lite/tools/converter/parser/tflite/tflite_reduce_parser.cc View File

@@ -96,6 +96,5 @@ TfliteNodeRegister g_TfliteReduceMaxParser("ReduceMax", new TfliteReduceMaxParse
TfliteNodeRegister g_TfliteReduceMinParser("ReduceMin", new TfliteReduceMinParser()); TfliteNodeRegister g_TfliteReduceMinParser("ReduceMin", new TfliteReduceMinParser());
TfliteNodeRegister g_TfliteReduceProdParser("ReduceProd", new TfliteReduceProdParser()); TfliteNodeRegister g_TfliteReduceProdParser("ReduceProd", new TfliteReduceProdParser());
TfliteNodeRegister g_TfliteReduceAnyParser("ReduceAny", new TfliteReduceAnyParser()); TfliteNodeRegister g_TfliteReduceAnyParser("ReduceAny", new TfliteReduceAnyParser());

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore

+ 0
- 1
mindspore/lite/tools/converter/parser/tflite/tflite_reduce_parser.h View File

@@ -67,7 +67,6 @@ class TfliteReduceAnyParser : public TfliteReduceParser {
public: public:
TfliteReduceAnyParser() : TfliteReduceParser() {} TfliteReduceAnyParser() : TfliteReduceParser() {}
}; };

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore




+ 1
- 1
mindspore/lite/tools/converter/parser/tflite/tflite_reshape_parser.cc View File

@@ -49,7 +49,7 @@ STATUS TfliteReshapeParser::Parse(const std::unique_ptr<tflite::OperatorT> &tfli
return RET_ERROR; return RET_ERROR;
} }
auto shape_tensor_index = tflite_op->inputs[1]; auto shape_tensor_index = tflite_op->inputs[1];
const auto & shape_tensor = tflite_tensors[shape_tensor_index];
const auto &shape_tensor = tflite_tensors[shape_tensor_index];
if (shape_tensor == nullptr) { if (shape_tensor == nullptr) {
MS_LOG(ERROR) << "shape_tensor is null"; MS_LOG(ERROR) << "shape_tensor is null";
return RET_NULL_PTR; return RET_NULL_PTR;


+ 3
- 3
mindspore/lite/tools/converter/parser/tflite/tflite_resize_parser.cc View File

@@ -71,13 +71,13 @@ STATUS TfliteResizeParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflit
attr->preserveAspectRatio = false; attr->preserveAspectRatio = false;


auto tfliteResizeTensorIndex = tflite_op->inputs[1]; auto tfliteResizeTensorIndex = tflite_op->inputs[1];
const auto & shape_tensor = tflite_tensors[tfliteResizeTensorIndex];
const auto &shape_tensor = tflite_tensors[tfliteResizeTensorIndex];
if (shape_tensor == nullptr) { if (shape_tensor == nullptr) {
MS_LOG(ERROR) << "shape_tensor is null"; MS_LOG(ERROR) << "shape_tensor is null";
return RET_NULL_PTR; return RET_NULL_PTR;
} }
auto resizeTensorBufferIndex = shape_tensor->buffer; auto resizeTensorBufferIndex = shape_tensor->buffer;
const auto & buff = tflite_model_buffer.at(resizeTensorBufferIndex);
const auto &buff = tflite_model_buffer.at(resizeTensorBufferIndex);
if (buff == nullptr) { if (buff == nullptr) {
MS_LOG(ERROR) << "buff_data is null"; MS_LOG(ERROR) << "buff_data is null";
return RET_NULL_PTR; return RET_NULL_PTR;
@@ -92,7 +92,7 @@ STATUS TfliteResizeParser::Parse(const std::unique_ptr<tflite::OperatorT> &tflit
op->primitive->value.value = attr.release(); op->primitive->value.value = attr.release();


AddOpInput(op, tensors_id, tensors_format, tensors_id_map, AddOpInput(op, tensors_id, tensors_format, tensors_id_map,
tflite_op->inputs[0], tensors_id->size(), tflite_tensors.size(), schema::Format_NHWC);
tflite_op->inputs[0], tensors_id->size(), tflite_tensors.size(), schema::Format_NHWC);
AddOpOutput(op, tensors_id, tensors_format, tensors_id_map, AddOpOutput(op, tensors_id, tensors_format, tensors_id_map,
tflite_op->outputs[0], tensors_id->size(), tflite_tensors.size(), schema::Format_NHWC); tflite_op->outputs[0], tensors_id->size(), tflite_tensors.size(), schema::Format_NHWC);
return RET_OK; return RET_OK;


+ 0
- 1
mindspore/lite/tools/converter/parser/tflite/tflite_resize_parser.h View File

@@ -47,7 +47,6 @@ class TfliteResizeNearestNeighborParser : public TfliteResizeParser {
public: public:
TfliteResizeNearestNeighborParser() : TfliteResizeParser() {} TfliteResizeNearestNeighborParser() : TfliteResizeParser() {}
}; };

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore




+ 1
- 1
mindspore/lite/tools/converter/parser/tflite/tflite_scatter_nd_parser.cc View File

@@ -54,7 +54,7 @@ STATUS TfliteScatterNdParser::Parse(const std::unique_ptr<tflite::OperatorT> &tf
// in tflite, kIndices = 0, kUpdates = 1, kShape = 2 // in tflite, kIndices = 0, kUpdates = 1, kShape = 2
// in mslite, kScatterShapeIndex = 0, kScatterIndicesIndex = 1, kScatterUpdateIndex = 2; // in mslite, kScatterShapeIndex = 0, kScatterIndicesIndex = 1, kScatterUpdateIndex = 2;
AddOpInput(op, tensors_id, tensors_format, tensors_id_map, AddOpInput(op, tensors_id, tensors_format, tensors_id_map,
tflite_op->inputs[2], tensors_id->size(), tflite_tensors.size(), schema::Format_NHWC);
tflite_op->inputs[2], tensors_id->size(), tflite_tensors.size(), schema::Format_NHWC);
AddOpInput(op, tensors_id, tensors_format, tensors_id_map, AddOpInput(op, tensors_id, tensors_format, tensors_id_map,
tflite_op->inputs[0], tensors_id->size(), tflite_tensors.size(), schema::Format_NHWC); tflite_op->inputs[0], tensors_id->size(), tflite_tensors.size(), schema::Format_NHWC);
AddOpInput(op, tensors_id, tensors_format, tensors_id_map, AddOpInput(op, tensors_id, tensors_format, tensors_id_map,


+ 4
- 5
mindspore/lite/tools/converter/parser/tflite/tflite_util.cc View File

@@ -192,10 +192,10 @@ size_t GetDataTypeSize(const TypeId &data_type) {
} }


STATUS getPaddingParam(const std::unique_ptr<tflite::TensorT> &tensor, STATUS getPaddingParam(const std::unique_ptr<tflite::TensorT> &tensor,
schema::PadMode pad_mode,
int strideH, int strideW,
int windowH, int windowW,
std::vector<int> *params) {
schema::PadMode pad_mode,
int strideH, int strideW,
int windowH, int windowW,
std::vector<int> *params) {
if (tensor == nullptr) { if (tensor == nullptr) {
MS_LOG(ERROR) << "the input tensor is null"; MS_LOG(ERROR) << "the input tensor is null";
return RET_ERROR; return RET_ERROR;
@@ -239,6 +239,5 @@ void Split(const std::string &src_str, std::vector<std::string> *dst_str, const
dst_str->push_back(src_str.substr(p1)); dst_str->push_back(src_str.substr(p1));
} }
} }

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore

+ 2
- 3
mindspore/lite/tools/converter/quantizer/general_bitpacking.cc View File

@@ -73,14 +73,13 @@ void BitPack::BitPacking(const std::vector<uint8_t>& originDataVec, std::vector<
} }


size_t remainBitData = bitDataVec.size(); size_t remainBitData = bitDataVec.size();
if ( 8 > remainBitData && remainBitData > 0 ) {
for ( int i = 0; i < 8 - remainBitData; i++ ) {
if (8 > remainBitData && remainBitData > 0) {
for (int i = 0; i < 8 - remainBitData; i++) {
bitDataVec.push(0); bitDataVec.push(0);
} }
PackFromOriginToUint8(bitDataVec, packedDataVec); PackFromOriginToUint8(bitDataVec, packedDataVec);
} }
} }

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore



+ 0
- 1
mindspore/lite/tools/converter/quantizer/post_training_quantizer.cc View File

@@ -42,7 +42,6 @@ using std::vector;
namespace mindspore { namespace mindspore {
namespace lite { namespace lite {
namespace quant { namespace quant {

struct DivergInfo { struct DivergInfo {
std::vector<float> histogram; std::vector<float> histogram;
CNodePtr cnode; CNodePtr cnode;


+ 0
- 2
mindspore/lite/tools/converter/quantizer/quantize_util.h View File

@@ -33,7 +33,6 @@
namespace mindspore { namespace mindspore {
namespace lite { namespace lite {
namespace quant { namespace quant {

static constexpr size_t UINT8_QUANTIZATION = 8; static constexpr size_t UINT8_QUANTIZATION = 8;


/** /**
@@ -124,7 +123,6 @@ STATUS QuantFilter(ParamValueLitePtr &weightPtr, QuantType quantType, int quant_
size_t bitNum = UINT8_QUANTIZATION, bool per_channel = false); size_t bitNum = UINT8_QUANTIZATION, bool per_channel = false);


STATUS PostBitPack(float *weights, size_t shapeSize, size_t bitNum = UINT8_QUANTIZATION); STATUS PostBitPack(float *weights, size_t shapeSize, size_t bitNum = UINT8_QUANTIZATION);

} // namespace quant } // namespace quant
} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore


+ 0
- 1
mindspore/lite/tools/converter/quantizer/weight_quantizer.cc View File

@@ -26,7 +26,6 @@ using std::vector;
namespace mindspore { namespace mindspore {
namespace lite { namespace lite {
namespace quant { namespace quant {

WeightQuantizer::WeightQuantizer(FuncGraphPtr graph, const string &weightSize, WeightQuantizer::WeightQuantizer(FuncGraphPtr graph, const string &weightSize,
const std::string &convWeightChannelThreshold, const std::string &bitNum) const std::string &convWeightChannelThreshold, const std::string &bitNum)
: Quantizer(graph) { : Quantizer(graph) {


+ 1
- 1
mindspore/lite/tools/optimizer/common/gllo_utils.cc View File

@@ -284,7 +284,7 @@ void CheckLeastInputSize(const CNodePtr &node, const int size) {
} }


ParameterPtr AddNewBiasNode(float *bias_data, const FuncGraphPtr &func_graph, int kernel_num, ParameterPtr AddNewBiasNode(float *bias_data, const FuncGraphPtr &func_graph, int kernel_num,
const ParamValueLitePtr &weight_tensor) {
const ParamValueLitePtr &weight_tensor) {
auto bias_parameter = func_graph->add_parameter(); auto bias_parameter = func_graph->add_parameter();
MS_ASSERT(bias_parameter != nullptr); MS_ASSERT(bias_parameter != nullptr);
std::vector<int> shape = {kernel_num}; std::vector<int> shape = {kernel_num};


+ 1
- 1
mindspore/lite/tools/optimizer/common/gllo_utils.h View File

@@ -48,7 +48,7 @@ void CheckIfNodeIsParam(const AnfNodePtr &node);
void CheckLeastInputSize(const CNodePtr &node, int size); void CheckLeastInputSize(const CNodePtr &node, int size);


ParameterPtr AddNewBiasNode(float *bias_data, const FuncGraphPtr &func_graph, int kernel_num, ParameterPtr AddNewBiasNode(float *bias_data, const FuncGraphPtr &func_graph, int kernel_num,
const ParamValueLitePtr &weight_tensor);
const ParamValueLitePtr &weight_tensor);


schema::PrimitiveType GetCNodeType(const BaseRef &node); schema::PrimitiveType GetCNodeType(const BaseRef &node);




+ 2
- 2
mindspore/lite/tools/optimizer/fusion/conv_activation_fusion.h View File

@@ -27,8 +27,8 @@ class ConvActivationFusion : public PatternProcessPass {
public: public:
explicit ConvActivationFusion(bool multigraph = true, const std::string &name = "conv_activation_fusion", explicit ConvActivationFusion(bool multigraph = true, const std::string &name = "conv_activation_fusion",
schema::PrimitiveType primitive = schema::PrimitiveType_LeakyReLU, schema::PrimitiveType primitive = schema::PrimitiveType_LeakyReLU,
schema::ActivationType activation = schema::ActivationType_LEAKY_RELU) : primitive_type(
primitive), activation_type(activation), PatternProcessPass(name, multigraph) {}
schema::ActivationType activation = schema::ActivationType_LEAKY_RELU)
: primitive_type(primitive), activation_type(activation), PatternProcessPass(name, multigraph) {}
~ConvActivationFusion() override = default; ~ConvActivationFusion() override = default;
const BaseRef DefinePattern() const override; const BaseRef DefinePattern() const override;
const AnfNodePtr Process(const FuncGraphPtr &, const AnfNodePtr &, const EquivPtr &) const override; const AnfNodePtr Process(const FuncGraphPtr &, const AnfNodePtr &, const EquivPtr &) const override;


+ 0
- 1
mindspore/lite/tools/time_profile/time_profile.cc View File

@@ -394,6 +394,5 @@ int RunTimeProfile(int argc, const char **argv) {


return RET_OK; return RET_OK;
} }

} // namespace lite } // namespace lite
} // namespace mindspore } // namespace mindspore

+ 0
- 1
mindspore/lite/tools/time_profile/time_profile.h View File

@@ -34,7 +34,6 @@


namespace mindspore { namespace mindspore {
namespace lite { namespace lite {

class MS_API TimeProfileFlags : public virtual FlagParser { class MS_API TimeProfileFlags : public virtual FlagParser {
public: public:
TimeProfileFlags() { TimeProfileFlags() {


Loading…
Cancel
Save