aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/lib/strings/numbers.h
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/core/lib/strings/numbers.h')
-rw-r--r--tensorflow/core/lib/strings/numbers.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/core/lib/strings/numbers.h b/tensorflow/core/lib/strings/numbers.h
index e9add42849..9cb56415cb 100644
--- a/tensorflow/core/lib/strings/numbers.h
+++ b/tensorflow/core/lib/strings/numbers.h
@@ -140,11 +140,11 @@ inline bool ProtoParseNumeric(StringPiece s, uint64* value) {
}
inline bool ProtoParseNumeric(StringPiece s, float* value) {
- return safe_strtof(s.ToString().c_str(), value);
+ return safe_strtof(std::string(s).c_str(), value);
}
inline bool ProtoParseNumeric(StringPiece s, double* value) {
- return safe_strtod(s.ToString().c_str(), value);
+ return safe_strtod(std::string(s).c_str(), value);
}
// Convert strings to number of type T.