提交 cd409ce1 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!5336 [MS][LITE]fix resize

Merge pull request !5336 from fuzhiye/tmp
......@@ -142,14 +142,14 @@ void Convolution3x3FP16CPUKernel::ConfigInputOutput() {
}
int Convolution3x3FP16CPUKernel::Init() {
if (!InferShapeDone()) {
return RET_OK;
}
auto ret = InitWeightBias();
if (ret != RET_OK) {
MS_LOG(ERROR) << "Init weight bias failed.";
return RET_ERROR;
}
if (!InferShapeDone()) {
return RET_OK;
}
return ReSize();
}
......
......@@ -102,8 +102,8 @@ int ConvolutionFP16CPUKernel::InitTmpBuffer() {
return RET_ERROR;
}
size_t nhwc4_input_size = channel_block * C4NUM * in_batch * conv_param_->input_h_ *
conv_param_->input_w_ * sizeof(float16_t);
size_t nhwc4_input_size =
channel_block * C4NUM * in_batch * conv_param_->input_h_ * conv_param_->input_w_ * sizeof(float16_t);
nhwc4_input_ = ctx_->allocator->Malloc(nhwc4_input_size);
if (nhwc4_input_ == nullptr) {
MS_LOG(ERROR) << "malloc nhwc4_input_ failed.";
......@@ -132,14 +132,14 @@ void ConvolutionFP16CPUKernel::ConfigInputOutput() {
}
int ConvolutionFP16CPUKernel::Init() {
if (!InferShapeDone()) {
return RET_OK;
}
auto ret = InitWeightBias();
if (ret != RET_OK) {
MS_LOG(ERROR) << "Init weight bias failed.";
return RET_ERROR;
}
if (!InferShapeDone()) {
return RET_OK;
}
ConfigInputOutput();
return ReSize();
}
......
......@@ -126,14 +126,14 @@ void ConvolutionSWFP16CPUKernel::ConfigInputOutput() {
}
int ConvolutionSWFP16CPUKernel::Init() {
if (!InferShapeDone()) {
return RET_OK;
}
auto ret = InitWeightBias();
if (ret != RET_OK) {
MS_LOG(ERROR) << "Init weight bias failed.";
return RET_ERROR;
}
if (!InferShapeDone()) {
return RET_OK;
}
ConfigInputOutput();
return ReSize();
}
......
......@@ -277,19 +277,18 @@ int ConvolutionWinogradFP16CPUKernel::ConfigInputOutput() {
}
int ConvolutionWinogradFP16CPUKernel::Init() {
if (!InferShapeDone()) {
return RET_OK;
}
kernel_unit_ = conv_param_->kernel_h_;
input_unit_ = output_unit_ + kernel_unit_ - 1;
conv_param_->input_unit_ = input_unit_;
conv_param_->output_unit_ = output_unit_;
auto ret = InitWeightBias();
if (ret != RET_OK) {
MS_LOG(ERROR) << "Init weight bias failed.";
return RET_ERROR;
}
if (!InferShapeDone()) {
return RET_OK;
}
return ReSize();
}
......
......@@ -125,14 +125,14 @@ void ConvolutionCPUKernel::ConfigInputOutput() {
}
int ConvolutionCPUKernel::Init() {
if (!InferShapeDone()) {
return RET_OK;
}
auto ret = InitWeightBias();
if (ret != RET_OK) {
MS_LOG(ERROR) << "Init weight bias failed.";
return RET_ERROR;
}
if (!InferShapeDone()) {
return RET_OK;
}
ConfigInputOutput();
return ReSize();
}
......
......@@ -155,14 +155,14 @@ void Convolution3x3CPUKernel::ConfigInputOutput() {
}
int Convolution3x3CPUKernel::Init() {
if (!InferShapeDone()) {
return RET_OK;
}
auto ret = InitWeightBias();
if (ret != RET_OK) {
MS_LOG(ERROR) << "Init weight bias failed.ret: " << ret;
return RET_ERROR;
}
if (!InferShapeDone()) {
return RET_OK;
}
ConfigInputOutput();
return ReSize();
}
......
......@@ -96,14 +96,14 @@ void ConvolutionSWCPUKernel::ConfigInputOutput() {
}
int ConvolutionSWCPUKernel::Init() {
if (!InferShapeDone()) {
return RET_OK;
}
auto ret = InitWeightBias();
if (ret != RET_OK) {
MS_LOG(ERROR) << "Init weight bias failed.";
return RET_ERROR;
}
if (!InferShapeDone()) {
return RET_OK;
}
// config input output
ConfigInputOutput();
return ReSize();
......
......@@ -270,19 +270,18 @@ int ConvolutionWinogradCPUKernel::ConfigInputOutput() {
}
int ConvolutionWinogradCPUKernel::Init() {
if (!InferShapeDone()) {
return RET_OK;
}
kernel_unit_ = conv_param_->kernel_h_;
input_unit_ = output_unit_ + kernel_unit_ - 1;
conv_param_->input_unit_ = input_unit_;
conv_param_->output_unit_ = output_unit_;
auto ret = InitWeightBias();
if (ret != RET_OK) {
MS_LOG(ERROR) << "Init weight bias failed.";
return RET_ERROR;
}
if (!InferShapeDone()) {
return RET_OK;
}
return ReSize();
}
......
......@@ -154,9 +154,8 @@ void Convolution3x3Int8CPUKernel::ConfigInputOutput() {
}
int Convolution3x3Int8CPUKernel::Init() {
if (!InferShapeDone()) {
return RET_OK;
}
// config input output
ConfigInputOutput();
auto ret = SetQuantParam();
if (ret != RET_OK) {
MS_LOG(ERROR) << "Set quant param failed.";
......@@ -167,8 +166,9 @@ int Convolution3x3Int8CPUKernel::Init() {
MS_LOG(ERROR) << "Init weight bias failed.";
return RET_ERROR;
}
// config input output
ConfigInputOutput();
if (!InferShapeDone()) {
return RET_OK;
}
return ReSize();
}
......
......@@ -247,9 +247,6 @@ void ConvolutionInt8CPUKernel::ConfigInputOutput() {
}
int ConvolutionInt8CPUKernel::Init() {
if (!InferShapeDone()) {
return RET_OK;
}
// config input output
ConfigInputOutput();
CheckSupportOptimize();
......@@ -273,7 +270,9 @@ int ConvolutionInt8CPUKernel::Init() {
return RET_ERROR;
}
}
if (!InferShapeDone()) {
return RET_OK;
}
return ReSize();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册