From f489d4405f65b8a8f05d53da012db8034d057efe Mon Sep 17 00:00:00 2001 From: Leran Wang <2428592483@qq.com> Date: Tue, 5 Sep 2023 17:04:19 +0800 Subject: [PATCH] Add more error checking --- src/layer/linearint8.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/layer/linearint8.cpp b/src/layer/linearint8.cpp index 30d87948f512..8b3d52cddfb8 100644 --- a/src/layer/linearint8.cpp +++ b/src/layer/linearint8.cpp @@ -27,6 +27,8 @@ int LinearInt8::load_param(const ParamDict& pd) in_dim = pd.get(0, 0); out_dim = pd.get(1, 0); group_size = pd.get(2, 1); + if (in_dim * out_dim % group_size) + return -1; return 0; }