fix compile error reported in issue #15911 (#15953)
authorJongsoo Park <jongsoo@fb.com>
Sun, 13 Jan 2019 05:00:25 +0000 (21:00 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sun, 13 Jan 2019 05:03:12 +0000 (21:03 -0800)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15953

Fix issue reported in https://github.com/pytorch/pytorch/issues/15911

Reviewed By: csummersea

Differential Revision: D13633256

fbshipit-source-id: 3808f100ff7dedfe5e20708e72e6081ff07eb32c

caffe2/quantization/server/activation_distribution_observer.cc
caffe2/quantization/server/caffe2_dnnlowp_utils.cc

index 36ac387..85401d2 100644 (file)
@@ -497,7 +497,7 @@ RegisterQuantizationParamsWithHistogramNetObserver::
     ++nwords_first_line;
   }
 
-  ist = istringstream(first_line);
+  ist.str(first_line);
 
   bool new_format = true;
   int op_index, i, nbins;
@@ -505,7 +505,7 @@ RegisterQuantizationParamsWithHistogramNetObserver::
   float min, max;
   ist >> op_index >> op_type >> i >> tensor_name >> min >> max >> nbins;
   if (nwords_first_line != nbins + 7) {
-    ist = istringstream(first_line);
+    ist.str(first_line);
     ist >> op_index >> i >> tensor_name >> min >> max >> nbins;
     if (nwords_first_line == nbins + 6) {
       new_format = false;
index 832bebc..d4ca0ba 100644 (file)
@@ -437,7 +437,7 @@ NetDef AddScaleZeroOffsetArgumentsWithHistogram(
     ++nwords_first_line;
   }
 
-  ist = istringstream(first_line);
+  ist.str(first_line);
 
   bool new_format = true;
   int op_index, i, nbins;
@@ -445,7 +445,7 @@ NetDef AddScaleZeroOffsetArgumentsWithHistogram(
   float min, max;
   ist >> op_index >> op_type >> i >> tensor_name >> min >> max >> nbins;
   if (nwords_first_line != nbins + 7) {
-    ist = istringstream(first_line);
+    ist.str(first_line);
     ist >> op_index >> i >> tensor_name >> min >> max >> nbins;
     if (nwords_first_line == nbins + 6) {
       new_format = false;