diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/scatter_nd_update_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/scatter_nd_update_fp32.cc index 97a2d18b771..a32feae3243 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/scatter_nd_update_fp32.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/scatter_nd_update_fp32.cc @@ -49,8 +49,6 @@ int ScatterNdUpdateCPUKernel::ReSize() { auto update = in_tensors_.at(kScatterUpdateIndex); auto output = out_tensors_.front(); - update_ptr_ = reinterpret_cast(update->MutableData()); - MS_ASSERT(update_ptr_ != nullptr); output_ptr_ = reinterpret_cast(output->MutableData()); MS_ASSERT(output_ptr_ != nullptr); @@ -151,6 +149,14 @@ int ScatterNdUpdateCPUKernel::Run() { out_tensor->set_own_data(in_tensor->own_data()); output_ptr_ = reinterpret_cast(out_tensor->data()); } + auto indices = in_tensors_.at(kScatterIndicesIndex); + if (!indices->IsConst() && ReSize() != RET_OK) { + MS_LOG(ERROR) << "ScatterNdUpdate resize failed."; + return RET_ERROR; + } + auto update = in_tensors_.at(kScatterUpdateIndex); + update_ptr_ = reinterpret_cast(update->MutableData()); + MS_ASSERT(update_ptr_ != nullptr); auto ret = ParallelLaunch(this->ms_context_, ScatterNdUpdateRun, this, thread_n_num_); if (ret != RET_OK) { diff --git a/mindspore/lite/tools/converter/parser/caffe/caffe_conv_base_parser.cc b/mindspore/lite/tools/converter/parser/caffe/caffe_conv_base_parser.cc index 46da969d710..6d7495931b6 100644 --- a/mindspore/lite/tools/converter/parser/caffe/caffe_conv_base_parser.cc +++ b/mindspore/lite/tools/converter/parser/caffe/caffe_conv_base_parser.cc @@ -149,7 +149,9 @@ int CaffeConvBaseParser::ParseGroup(const caffe::ConvolutionParameter &convParam if (convParam.has_group()) { return convParam.group(); } else { - return layerType == "ConvolutionDepthwise" ? static_cast(convParam.num_output()) : 1; + return layerType == "ConvolutionDepthwise" || layerType == "DepthwiseConv" + ? static_cast(convParam.num_output()) + : 1; } } diff --git a/mindspore/lite/tools/converter/parser/caffe/caffe_convolution_parser.cc b/mindspore/lite/tools/converter/parser/caffe/caffe_convolution_parser.cc index af528e8e7c7..070db9196f3 100644 --- a/mindspore/lite/tools/converter/parser/caffe/caffe_convolution_parser.cc +++ b/mindspore/lite/tools/converter/parser/caffe/caffe_convolution_parser.cc @@ -92,5 +92,6 @@ ops::PrimitiveC *CaffeConvolutionParser::Parse(const caffe::LayerParameter &prot } CaffeNodeRegistrar g_caffeConvolutionParser("Convolution", new CaffeConvolutionParser()); +CaffeNodeRegistrar g_caffeDepthwiseConvolutionParser("DepthwiseConv", new CaffeConvolutionParser()); } // namespace lite } // namespace mindspore