diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-05-02 18:52:02 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-05-02 18:55:37 -0700 |
commit | 223be4abe74592a781735a6b66e12cb0146f0830 (patch) | |
tree | 40171aa19e37c27169ec94e745354e8020107842 /tensorflow/core/debug | |
parent | 2b1a03c2ad502329a1f2b1368a40913ef21e97a0 (diff) |
Replaced calls to tensorflow::StringPiece::ToString with std::string conversions.
That is, instances of sp.ToString() are replaced with std::string(sp).
This will allow tensorflow::StringPiece::ToString to be removed, which is necessary before it can be replaced with absl::string_view.
PiperOrigin-RevId: 195188185
Diffstat (limited to 'tensorflow/core/debug')
-rw-r--r-- | tensorflow/core/debug/debug_graph_utils.cc | 7 | ||||
-rw-r--r-- | tensorflow/core/debug/debug_io_utils.cc | 10 |
2 files changed, 8 insertions, 9 deletions
diff --git a/tensorflow/core/debug/debug_graph_utils.cc b/tensorflow/core/debug/debug_graph_utils.cc index 4539ea5c0c..7641edea52 100644 --- a/tensorflow/core/debug/debug_graph_utils.cc +++ b/tensorflow/core/debug/debug_graph_utils.cc @@ -356,10 +356,9 @@ Status DebugNodeInserter::ParseDebugOpName( "Malformed attributes in debug op name \"", debug_op_name, "\""); } - const string key = seg.substr(0, eq_index).ToString(); - const string value = - seg.substr(eq_index + 1, attribute_seg.size() - eq_index - 1) - .ToString(); + const string key = std::string(seg.substr(0, eq_index)); + const string value = std::string( + seg.substr(eq_index + 1, attribute_seg.size() - eq_index - 1)); if (key.empty() || value.empty()) { return errors::InvalidArgument( "Malformed attributes in debug op name \"", debug_op_name, "\""); diff --git a/tensorflow/core/debug/debug_io_utils.cc b/tensorflow/core/debug/debug_io_utils.cc index baa8c08fdf..4998a7acfe 100644 --- a/tensorflow/core/debug/debug_io_utils.cc +++ b/tensorflow/core/debug/debug_io_utils.cc @@ -399,8 +399,8 @@ Status DebugIO::PublishDebugMetadata( strings::Printf("%.14lld", session_run_index))), Env::Default()->NowMicros()); status.Update(DebugFileIO::DumpEventProtoToFile( - event, io::Dirname(core_metadata_path).ToString(), - io::Basename(core_metadata_path).ToString())); + event, std::string(io::Dirname(core_metadata_path)), + std::string(io::Basename(core_metadata_path)))); } } @@ -632,8 +632,8 @@ Status DebugFileIO::DumpTensorToEventFile(const DebugNodeKey& debug_node_key, std::vector<Event> events; TF_RETURN_IF_ERROR( WrapTensorAsEvents(debug_node_key, tensor, wall_time_us, 0, &events)); - return DumpEventProtoToFile(events[0], io::Dirname(file_path).ToString(), - io::Basename(file_path).ToString()); + return DumpEventProtoToFile(events[0], std::string(io::Dirname(file_path)), + std::string(io::Basename(file_path))); } Status DebugFileIO::RecursiveCreateDir(Env* env, const string& dir) { @@ -642,7 +642,7 @@ Status DebugFileIO::RecursiveCreateDir(Env* env, const string& dir) { return Status::OK(); } - string parent_dir = io::Dirname(dir).ToString(); + string parent_dir = std::string(io::Dirname(dir)); if (!env->FileExists(parent_dir).ok()) { // The parent path does not exist yet, create it first. Status s = RecursiveCreateDir(env, parent_dir); // Recursive call |