summaryrefslogtreecommitdiff
path: root/binaries
diff options
context:
space:
mode:
authorZhizhen Qin <eliqinzz@gmail.com>2019-02-14 17:22:34 -0800
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2019-02-14 17:29:14 -0800
commit6a467389863aa360cf09715dc5c0301805abb44e (patch)
treeb7fb8477d450b43786d09d8b975ed74f4e47c9b9 /binaries
parentd61455cf4017c0b9e8a9668b18f086c736b2813e (diff)
downloadpytorch-6a467389863aa360cf09715dc5c0301805abb44e.tar.gz
pytorch-6a467389863aa360cf09715dc5c0301805abb44e.tar.bz2
pytorch-6a467389863aa360cf09715dc5c0301805abb44e.zip
Fix android crash when model detects nothing
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/17119 Reviewed By: sf-wind Differential Revision: D14087835 Pulled By: ZhizhenQin fbshipit-source-id: 32e61d46679bae645fd0bbec724513cfa5c553ab
Diffstat (limited to 'binaries')
-rw-r--r--binaries/benchmark_helper.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/binaries/benchmark_helper.h b/binaries/benchmark_helper.h
index 8c24a3d943..d09ba4e9c5 100644
--- a/binaries/benchmark_helper.h
+++ b/binaries/benchmark_helper.h
@@ -82,7 +82,9 @@ void writeTextOutput(
}
// remove the last ,
string str = line.str();
- str.pop_back();
+ if(str.length() != 0) {
+ str.pop_back();
+ }
lines.push_back(str);
// static casts are workaround for MSVC build