From 69506ad00c8c0d3b0927c867159ea5958e9cc2d3 Mon Sep 17 00:00:00 2001 From: xuanyue Date: Tue, 17 Aug 2021 16:34:30 +0800 Subject: [PATCH] code check edit --- .../ccsrc/backend/kernel_compiler/cpu/nnacl/int8/power_int8.c | 2 +- .../ccsrc/backend/kernel_compiler/cpu/nnacl/int8/power_int8.h | 3 ++- .../backend/kernel_compiler/cpu/nnacl/int8/unsqueeze_int8.c | 2 +- .../backend/kernel_compiler/cpu/nnacl/int8/unsqueeze_int8.h | 2 +- .../lite/examples/runtime_extend/src/custom_add_kernel.cc | 2 ++ mindspore/lite/tools/optimizer/fusion/gelu_fusion.cc | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/power_int8.c b/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/power_int8.c index 6932500b70e..593391cbf89 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/power_int8.c +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/power_int8.c @@ -16,7 +16,7 @@ #include "nnacl/int8/power_int8.h" -int PowerInt8(const int8_t *input, const int8_t *exp_ptr, int8_t *output, int count, PowerParameter *param) { +int PowerInt8(const int8_t *input, const int8_t *exp_ptr, int8_t *output, int count, const PowerParameter *param) { double input_scale = param->quant_arg_.in_args_.scale_; int input_zp = param->quant_arg_.in_args_.zp_; double output_scale = param->quant_arg_.out_args_.scale_; diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/power_int8.h b/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/power_int8.h index be86ea03291..e36db54a420 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/power_int8.h +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/power_int8.h @@ -24,7 +24,8 @@ #ifdef __cplusplus extern "C" { #endif -int PowerInt8(const int8_t *input_ptr, const int8_t *exp_ptr, int8_t *output_ptr, int count, PowerParameter *parameter); +int PowerInt8(const int8_t *input_ptr, const int8_t *exp_ptr, int8_t *output_ptr, int count, + const PowerParameter *parameter); #ifdef __cplusplus } #endif diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/unsqueeze_int8.c b/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/unsqueeze_int8.c index e5f8c0aab59..1a67043e64a 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/unsqueeze_int8.c +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/unsqueeze_int8.c @@ -17,7 +17,7 @@ #include "nnacl/int8/unsqueeze_int8.h" #include "nnacl/unsqueeze_parameter.h" -int Int8Unsqueeze(const int8_t *input_ptr, int8_t *output_ptr, UnSqueezeParameter *para_, size_t data_size, +int Int8Unsqueeze(const int8_t *input_ptr, int8_t *output_ptr, const UnSqueezeParameter *para_, size_t data_size, int task_id) { float output_scale = para_->quant_arg.out_quant_args_.scale_; int8_t output_zp = para_->quant_arg.out_quant_args_.zp_; diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/unsqueeze_int8.h b/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/unsqueeze_int8.h index 0fe040d9522..6943f18c20c 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/unsqueeze_int8.h +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/int8/unsqueeze_int8.h @@ -24,7 +24,7 @@ #ifdef __cplusplus extern "C" { #endif -int Int8Unsqueeze(const int8_t *input_ptr, int8_t *output_ptr, UnSqueezeParameter *para_, size_t data_size, +int Int8Unsqueeze(const int8_t *input_ptr, int8_t *output_ptr, const UnSqueezeParameter *para_, size_t data_size, int task_id); #ifdef __cplusplus } diff --git a/mindspore/lite/examples/runtime_extend/src/custom_add_kernel.cc b/mindspore/lite/examples/runtime_extend/src/custom_add_kernel.cc index ead729ef82f..045ed2a3301 100644 --- a/mindspore/lite/examples/runtime_extend/src/custom_add_kernel.cc +++ b/mindspore/lite/examples/runtime_extend/src/custom_add_kernel.cc @@ -33,6 +33,8 @@ class CustomAddKernel : public Kernel { CustomAddKernel(const std::vector &inputs, const std::vector &outputs, const schema::Primitive *primitive, const mindspore::Context *ctx) : Kernel(inputs, outputs, primitive, ctx) {} + ~CustomAddKernel() = default; + // Prepare will be called during graph compilation int Prepare() override { return lite::RET_OK; } diff --git a/mindspore/lite/tools/optimizer/fusion/gelu_fusion.cc b/mindspore/lite/tools/optimizer/fusion/gelu_fusion.cc index 7cb4176b1a8..319b594f8fe 100644 --- a/mindspore/lite/tools/optimizer/fusion/gelu_fusion.cc +++ b/mindspore/lite/tools/optimizer/fusion/gelu_fusion.cc @@ -41,7 +41,7 @@ CNodePtr GeLUFusion::CreateGeLUNode(const FuncGraphPtr &func_graph, const AnfNod const float GeLUFusion::GetParameterValue(const EquivPtr &equiv, const VarPtr &input) const { MS_ASSERT(equiv != nullptr); MS_ASSERT(input != nullptr); - float value = -1; + const float value = -1; auto node = utils::cast((*equiv)[input]); if (node == nullptr || !utils::isa(node)) { return value;