165 Star 1K Fork 237

MindSpore / community

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mssa-2021-004.patch 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
chengxb7532 提交于 2021-09-19 18:25 . issue mindspore SA
From e0cbe113745a38be7b3afa0dff63a819e4490005 Mon Sep 17 00:00:00 2001
From: lzk <liuzhongkai2@huawei.com>
Date: Fri, 21 May 2021 01:11:07 -0700
Subject: [PATCH] div 0 bug fix
---
.../lite/tools/converter/parser/tflite/tflite_conv_parser.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/mindspore/lite/tools/converter/parser/tflite/tflite_conv_parser.cc b/mindspore/lite/tools/converter/parser/tflite/tflite_conv_parser.cc
index 3e552883af..c2aac03799 100644
--- a/mindspore/lite/tools/converter/parser/tflite/tflite_conv_parser.cc
+++ b/mindspore/lite/tools/converter/parser/tflite/tflite_conv_parser.cc
@@ -111,6 +111,10 @@ ops::PrimitiveC *TfliteDepthwiseConv2DParser::Parse(const std::unique_ptr<tflite
auto weight_shape = weight_tensor->shape;
prim->set_kernel_size({weight_shape[1], weight_shape[2]});
prim->set_in_channel(weight_shape[3]);
+ if (tflite_attr->depth_multiplier == 0) {
+ MS_LOG(ERROR) << "depth_multiplier must not be zero!";
+ return nullptr;
+ }
prim->set_group(weight_shape[3] / tflite_attr->depth_multiplier);
// get data tensor
--
2.17.1
1
https://gitee.com/mindspore/community.git
git@gitee.com:mindspore/community.git
mindspore
community
community
master

搜索帮助