Browse Source

support the scientific notation when parsing layer's paramters.

tags/20180427
Yantao Xie nihui 8 years ago
parent
commit
89c7aa26f8
2 changed files with 3 additions and 2 deletions
  1. +2
    -1
      src/paramdict.cpp
  2. +1
    -1
      tools/ncnn2mem.cpp

+ 2
- 1
src/paramdict.cpp View File

@@ -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 <ctype.h>
#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;
}



+ 1
- 1
tools/ncnn2mem.cpp View File

@@ -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;
}



Loading…
Cancel
Save