From ff6a89119837fa22c97add211fa5353ec4ad17d3 Mon Sep 17 00:00:00 2001 From: zengxianglong Date: Thu, 29 Oct 2020 20:27:20 +0800 Subject: [PATCH] fix some operator bugs --- mindspore/lite/src/runtime/kernel/arm/fp32/cast.cc | 3 +-- mindspore/lite/tools/converter/parser/onnx/onnx_conv_parser.cc | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/cast.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/cast.cc index cf07155ea1..8dca41b862 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/cast.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/cast.cc @@ -83,8 +83,7 @@ int CastCPUKernel::DoCast(int thread_id) { } else if (input_data_type == kNumberTypeInt32 && output_data_type == kNumberTypeInt64) { Int32ToInt64(reinterpret_cast(input->data_c()) + offset, reinterpret_cast(output_data) + offset, data_num); - } else if (input_data_type == kNumberTypeInt32 && - (output_data_type == kNumberTypeInt32 || output_data_type == kNumberTypeInt64)) { + } else if (input_data_type == kNumberTypeInt32 && output_data_type == kNumberTypeInt32) { memcpy(reinterpret_cast(output_data) + offset, reinterpret_cast(input->data_c()) + offset, data_num * sizeof(int32_t)); } else { diff --git a/mindspore/lite/tools/converter/parser/onnx/onnx_conv_parser.cc b/mindspore/lite/tools/converter/parser/onnx/onnx_conv_parser.cc index 8490698c6d..158c774640 100644 --- a/mindspore/lite/tools/converter/parser/onnx/onnx_conv_parser.cc +++ b/mindspore/lite/tools/converter/parser/onnx/onnx_conv_parser.cc @@ -172,7 +172,7 @@ STATUS OnnxConvParser::Parse(const onnx::GraphProto &onnx_graph, const onnx::Nod attr->activationType = schema::ActivationType_NO_ACTIVATION; } - if (attr->group > kSingleGrounp) { + if (attr->group > kSingleGrounp && attr->group == attr->channelIn) { if (!ParseGroupConvolution(attr, op)) { MS_LOG(ERROR) << "Convert Convolution to Depthwise failed"; return RET_ERROR;