Merge pull request !17964 from zhaozhenlong/lite/issue/code_check0608
This commit is contained in:
i-robot 2021-06-08 17:18:33 +08:00 committed by Gitee
commit c99940a702
6 changed files with 9 additions and 8 deletions

View File

@ -110,5 +110,4 @@ int ConvolutionDepthwiseFp16CPUKernel::Run() {
}
return ret;
}
} // namespace mindspore::kernel

View File

@ -15,7 +15,7 @@
*/
#include "src/runtime/kernel/arm/fp32/exp_fp32.h"
#include <math.h>
#include <cmath>
#include "include/errorcode.h"
#include "src/kernel_registry.h"

View File

@ -189,8 +189,8 @@ int MatmulFp32BaseCPUKernel::InitMatrixB(const float *src_ptr) {
} else {
for (int i = 0; i < params_->batch; i++) {
const float *src_data = src_ptr + i * params_->deep_ * params_->col_;
float *dst = b_pack_ptr_ + i * params_->deep_ * params_->col_;
RowMajor2ColMajor(src_data, dst, params_->deep_, params_->col_);
float *dst_data = b_pack_ptr_ + i * params_->deep_ * params_->col_;
RowMajor2ColMajor(src_data, dst_data, params_->deep_, params_->col_);
}
}
return RET_OK;

View File

@ -39,6 +39,10 @@ constexpr size_t kScoreTensorIndex = 1;
constexpr size_t kMaxOutputNumTensorIndex = 2;
constexpr size_t kIoUThresholdTensorIndex = 3;
constexpr size_t kScoreThresholdTensorIndex = 4;
constexpr size_t kYIndexA = 0;
constexpr size_t kYIndexB = 2;
constexpr size_t kXIndexA = 1;
constexpr size_t kXIndexB = 3;
constexpr int kBoxPointNum = 4;
} // namespace
@ -118,8 +122,8 @@ int NonMaxSuppressionCPUKernel::Run_Selecte(bool simple_out, int box_num, int ba
above_score_candidates.reserve(box_num);
for (auto k = 0; k < box_num; ++k) {
if (per_class_scores[k] > score_threshold_) {
above_score_candidates.emplace_back(per_class_scores[k], k, center_point_box_, box[0], box[1], box[2],
box[3]);
above_score_candidates.emplace_back(per_class_scores[k], k, center_point_box_, box[kYIndexA], box[kXIndexA],
box[kYIndexB], box[kXIndexB]);
}
box += kBoxPointNum;
}

View File

@ -104,5 +104,4 @@ int SkipGramCPUKernel::Run() {
}
REG_KERNEL(kCPU, kNumberTypeFloat32, PrimitiveType_SkipGram, LiteKernelCreator<SkipGramCPUKernel>)
} // namespace mindspore::kernel

View File

@ -24,7 +24,6 @@ using mindspore::schema::PrimitiveType_Transpose;
namespace mindspore::kernel {
namespace {
constexpr size_t TRANSPOSE_INPUT_SIZE = 2;
} // namespace
int TransposeNPUKernel::IsSupport(const std::vector<lite::Tensor *> &inputs, const std::vector<lite::Tensor *> &outputs,
OpParameter *opParameter) {