Browse Source

!12024 [ms][lite][cpu] fix fp16 bug

From: @lzkcode
Reviewed-by: @zhanghaibo5,@zhang_xue_tong
Signed-off-by: @zhang_xue_tong
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 4 years ago
parent
commit
c06f200ac3
2 changed files with 2 additions and 1 deletions
  1. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/fp16/bias_fp16.cc
  2. +1
    -0
      mindspore/lite/src/runtime/kernel/arm/fp16/transpose_fp16.cc

+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/fp16/bias_fp16.cc View File

@@ -82,7 +82,7 @@ int BiasCPUFp16Kernel::Init() {
return RET_NULL_PTR;
}
auto *bias = reinterpret_cast<float *>(bias_tensor->MutableData());
if (bias != nullptr) {
if (bias == nullptr) {
MS_LOG(ERROR) << "bias is nullptr!";
return RET_NULL_PTR;
}


+ 1
- 0
mindspore/lite/src/runtime/kernel/arm/fp16/transpose_fp16.cc View File

@@ -40,6 +40,7 @@ int TransposeFp16CPUKernel::Init() {
int TransposeFp16CPUKernel::Run() {
MS_ASSERT(in_tensors_.size() == 1 || in_tensors_.size() == 2);
TransposeParameter *param = reinterpret_cast<TransposeParameter *>(this->op_parameter_);
param->data_size_ = in_tensors_[0]->Size();
if (in_tensors_.size() == 2) {
auto input_perm = in_tensors_.at(1);
MS_ASSERT(input_perm != nullptr);


Loading…
Cancel
Save