diff --git a/mindspore/lite/src/ops/depthwise_conv2d.cc b/mindspore/lite/src/ops/depthwise_conv2d.cc index 820ebb10c5..32a8b50a19 100644 --- a/mindspore/lite/src/ops/depthwise_conv2d.cc +++ b/mindspore/lite/src/ops/depthwise_conv2d.cc @@ -92,9 +92,15 @@ int DepthwiseConv2D::UnPackAttr(const Primitive &prim, const std::vectordilateH = dilation[0]; attr->dilateW = dilation[1]; - auto kernel_size = GetValue>(prim.GetAttr("kernel_size")); - attr->kernelH = kernel_size[0]; - attr->kernelW = kernel_size[1]; + if (utils::isa(prim.GetAttr("kernel_size"))) { + auto kernel_size = GetValue>(prim.GetAttr("kernel_size")); + attr->kernelH = kernel_size[0]; + attr->kernelW = kernel_size[1]; + } else { + auto kernel_size = GetValue(prim.GetAttr("kernel_size")); + attr->kernelH = kernel_size; + attr->kernelW = kernel_size; + } auto stride = GetValue>(prim.GetAttr("stride")); attr->strideH = stride[2]; diff --git a/mindspore/lite/src/runtime/kernel/arm/base/resize_base.cc b/mindspore/lite/src/runtime/kernel/arm/base/resize_base.cc index a819d0a627..8e0b8c0f45 100644 --- a/mindspore/lite/src/runtime/kernel/arm/base/resize_base.cc +++ b/mindspore/lite/src/runtime/kernel/arm/base/resize_base.cc @@ -58,7 +58,7 @@ int ResizeBaseCPUKernel::CheckParameters() { return RET_INVALID_OP_ATTR; } } else if (this->in_tensors_.size() == lite::kDoubleNum) { - auto out_shape = this->in_tensors_[1]->MutableData(); + auto out_shape = this->in_tensors_[1]->data_c(); if (out_shape == nullptr) { MS_LOG(INFO) << "Out shape is not assigned"; const_shape_ = false; diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/pad_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/pad_int8.cc index 0ca7518696..b5885fb6e5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/pad_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/pad_int8.cc @@ -23,8 +23,8 @@ using mindspore::lite::RET_ERROR; using mindspore::lite::RET_MEMORY_FAILED; -using mindspore::lite::RET_OK; using mindspore::lite::RET_NULL_PTR; +using mindspore::lite::RET_OK; namespace mindspore::kernel { @@ -213,12 +213,10 @@ int PadInt8CPUKernel::CheckPaddings(int *paddings, int length, int *input_shape, for (auto i = 0; i < length; ++i) { int max_valid = input_shape[i] - offset; if (paddings[i * 2] > max_valid) { - MS_LOG(ERROR) << prefix << "paddings " << paddings[i * 2] << "should be less than " << max_valid + 1; - return RET_ERROR; + MS_LOG(WARNING) << prefix << "paddings " << paddings[i * 2] << "should be more than " << max_valid + 1; } if (paddings[i * 2 + 1] > max_valid) { - MS_LOG(ERROR) << prefix << "paddings " << paddings[i * 2 + 1] << "should be less than " << max_valid + 1; - return RET_ERROR; + MS_LOG(WARNING) << prefix << "paddings " << paddings[i * 2 + 1] << "should be less than " << max_valid + 1; } } return RET_OK; @@ -278,7 +276,6 @@ int PadInt8CPUKernel::Run() { } } - return RET_OK; } } // namespace mindspore::kernel