Browse Source

!4827 [MS][LITE][BUG]set bias to zero

Merge pull request !4827 from fuzhiye/tmp
tags/v0.7.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
6225ad6841
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      mindspore/lite/src/runtime/kernel/arm/fp32/convolution.cc
  2. +1
    -1
      mindspore/lite/src/runtime/kernel/arm/int8/convolution_int8.cc

+ 1
- 0
mindspore/lite/src/runtime/kernel/arm/fp32/convolution.cc View File

@@ -68,6 +68,7 @@ int ConvolutionCPUKernel::InitWeightBias() {
MS_LOG(ERROR) << "malloc bias failed.";
return RET_ERROR;
}
memset(bias_data_, 0, oc_block_num * oc_block * sizeof(float));

if (in_tensors_.size() == kInputSize2) {
auto ori_bias = reinterpret_cast<float *>(in_tensors_.at(kBiasIndex)->Data());


+ 1
- 1
mindspore/lite/src/runtime/kernel/arm/int8/convolution_int8.cc View File

@@ -297,7 +297,7 @@ int ConvolutionInt8CPUKernel::ReSize() {
MS_LOG(ERROR) << "ConvolutionBase init failed.";
return RET_ERROR;
}
/*=============================nhwc4_input_============================*/
int ic4 = UP_DIV(conv_param_->input_channel_, C4NUM);
size_t nhwc4_input_size = ic4 * C4NUM * conv_param_->input_batch_ * conv_param_->input_h_ * conv_param_->input_w_;
nhwc4_input_ = malloc(nhwc4_input_size);


Loading…
Cancel
Save