From 89c7aa26f899088558d9874d4d64c1341eea6b0e Mon Sep 17 00:00:00 2001 From: Yantao Xie Date: Mon, 23 Apr 2018 14:28:33 +0800 Subject: [PATCH] support the scientific notation when parsing layer's paramters. --- src/paramdict.cpp | 3 ++- tools/ncnn2mem.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/paramdict.cpp b/src/paramdict.cpp index cff289077..d901dabe0 100644 --- a/src/paramdict.cpp +++ b/src/paramdict.cpp @@ -12,6 +12,7 @@ // CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. +#include #include "paramdict.h" #include "platform.h" @@ -74,7 +75,7 @@ static bool vstr_is_float(const char vstr[16]) if (vstr[j] == '\0') break; - if (vstr[j] == '.') + if (vstr[j] == '.' || tolower(vstr[j]) == 'e') return true; } diff --git a/tools/ncnn2mem.cpp b/tools/ncnn2mem.cpp index 8134caba0..bc117fbb3 100644 --- a/tools/ncnn2mem.cpp +++ b/tools/ncnn2mem.cpp @@ -67,7 +67,7 @@ static bool vstr_is_float(const char vstr[16]) if (vstr[j] == '\0') break; - if (vstr[j] == '.') + if (vstr[j] == '.' || tolower(vstr[j]) == 'e') return true; }