aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/lib
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-05-31 19:01:44 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-05-31 19:04:19 -0700
commitd3095c93fc042cf6200f5552e910804e1f9dc196 (patch)
treed6aa6f0266ce41be3f3a6514b113812391b7eb97 /tensorflow/core/lib
parent16c6cac5c57b632a82bde1117d441ab230414b5c (diff)
Automated g4 rollback of changelist 198812512
PiperOrigin-RevId: 198815200
Diffstat (limited to 'tensorflow/core/lib')
-rw-r--r--tensorflow/core/lib/strings/numbers.cc26
-rw-r--r--tensorflow/core/lib/strings/numbers.h2
2 files changed, 0 insertions, 28 deletions
diff --git a/tensorflow/core/lib/strings/numbers.cc b/tensorflow/core/lib/strings/numbers.cc
index f18c6dc709..987e4fe733 100644
--- a/tensorflow/core/lib/strings/numbers.cc
+++ b/tensorflow/core/lib/strings/numbers.cc
@@ -345,19 +345,6 @@ bool safe_strtof(const char* str, float* value) {
return processed_characters_count > 0;
}
-bool safe_strtof(StringPiece str, float* value) {
- int processed_characters_count = -1;
- auto len = str.size();
-
- // If string length exceeds buffer size or int max, fail.
- if (len >= kFastToBufferSize) return false;
- if (len > std::numeric_limits<int>::max()) return false;
-
- *value = StringToFloatConverter().StringToFloat(
- str.data(), static_cast<int>(len), &processed_characters_count);
- return processed_characters_count > 0;
-}
-
bool safe_strtod(const char* str, double* value) {
int processed_characters_count = -1;
auto len = str_util::Strnlen(str, kFastToBufferSize);
@@ -372,19 +359,6 @@ bool safe_strtod(const char* str, double* value) {
return processed_characters_count > 0;
}
-bool safe_strtod(StringPiece str, double* value) {
- int processed_characters_count = -1;
- auto len = str.size();
-
- // If string length exceeds buffer size or int max, fail.
- if (len >= kFastToBufferSize) return false;
- if (len > std::numeric_limits<int>::max()) return false;
-
- *value = StringToFloatConverter().StringToDouble(
- str.data(), static_cast<int>(len), &processed_characters_count);
- return processed_characters_count > 0;
-}
-
size_t FloatToBuffer(float value, char* buffer) {
// FLT_DIG is 6 for IEEE-754 floats, which are used on almost all
// platforms these days. Just in case some system exists where FLT_DIG
diff --git a/tensorflow/core/lib/strings/numbers.h b/tensorflow/core/lib/strings/numbers.h
index f62584dedb..9cb56415cb 100644
--- a/tensorflow/core/lib/strings/numbers.h
+++ b/tensorflow/core/lib/strings/numbers.h
@@ -116,14 +116,12 @@ bool safe_strtou64(StringPiece str, uint64* value);
// Values may be rounded on over- and underflow.
// Returns false on invalid input or if `strlen(value) >= kFastToBufferSize`.
bool safe_strtof(const char* str, float* value);
-bool safe_strtof(StringPiece str, float* value);
// Convert strings to double precision floating point values.
// Leading and trailing spaces are allowed.
// Values may be rounded on over- and underflow.
// Returns false on invalid input or if `strlen(value) >= kFastToBufferSize`.
bool safe_strtod(const char* str, double* value);
-bool safe_strtod(StringPiece str, double* value);
inline bool ProtoParseNumeric(StringPiece s, int32* value) {
return safe_strto32(s, value);