diff --git a/tsl/platform/numbers.cc b/tsl/platform/numbers.cc index a675403f4..f9d470544 100644 --- a/tsl/platform/numbers.cc +++ b/tsl/platform/numbers.cc @@ -233,7 +233,7 @@ size_t FloatToBuffer(float value, char* buffer) { DCHECK(snprintf_result > 0 && snprintf_result < kFastToBufferSize); float parsed_value; - if (!safe_strtof(buffer, &parsed_value) || parsed_value != value) { + if (!absl::SimpleAtof(buffer, &parsed_value) || parsed_value != value) { snprintf_result = snprintf(buffer, kFastToBufferSize, "%.*g", FLT_DIG + 3, value); diff --git a/tsl/platform/numbers.h b/tsl/platform/numbers.h index ab21c23db..166dab918 100644 --- a/tsl/platform/numbers.h +++ b/tsl/platform/numbers.h @@ -136,27 +136,27 @@ inline bool safe_strtod(absl::string_view str, double* value) { } inline bool ProtoParseNumeric(absl::string_view s, int32_t* value) { - return safe_strto32(s, value); + return absl::SimpleAtoi(s, value); } inline bool ProtoParseNumeric(absl::string_view s, uint32_t* value) { - return safe_strtou32(s, value); + return absl::SimpleAtoi(s, value); } inline bool ProtoParseNumeric(absl::string_view s, int64_t* value) { - return safe_strto64(s, value); + return absl::SimpleAtoi(s, value); } inline bool ProtoParseNumeric(absl::string_view s, uint64_t* value) { - return safe_strtou64(s, value); + return absl::SimpleAtoi(s, value); } inline bool ProtoParseNumeric(absl::string_view s, float* value) { - return safe_strtof(s, value); + return absl::SimpleAtof(s, value); } inline bool ProtoParseNumeric(absl::string_view s, double* value) { - return safe_strtod(s, value); + return absl::SimpleAtod(s, value); } // Convert strings to number of type T.