This website works better with JavaScript.
Home
Issues
Pull Requests
Milestones
Repositories
Datasets
Forum
实训
竞赛
大数据
应用
Register
Sign In
OpenI
/
MegEngine
Not watched
Unwatch
Watch all
Watch but not notify
1
Star
0
Fork
0
Code
Releases
31
Wiki
Activity
Issues
0
Pull Requests
0
Datasets
Model
Cloudbrain
Browse Source
fix(src/json): fix parsing error when inf is dumped as a Number
GitOrigin-RevId:
62cfba48c0
release-1.6
Megvii Engine Team
3 years ago
parent
16678bb998
commit
f9722af3df
1 changed files
with
8 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+8
-0
src/core/impl/utils/json.cpp
+ 8
- 0
src/core/impl/utils/json.cpp
View File
@@ -52,6 +52,14 @@ void Value::writeto_fpath(const char* fout_path, int indent) const {
}
void Number::writeto(std::string& fout, int) const {
if (std::isinf(m_val)){
fout += "\"inf\"";
return ;
}
if (std::isnan(m_val)){
fout += "\"nan\"";
return ;
}
static char fmt[16];
static Spinlock fmt_mtx;
if (!fmt[sizeof(fmt) - 1]) {
Write
Preview
Loading…
Cancel
Save