aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/session_bundle
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-08-22 12:09:20 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-22 12:12:38 -0700
commit36e475ce4d0a3565a81329641e2a95152eb9ebc6 (patch)
tree37011a00288bc7a30d7ed0eadb6775e50318de61 /tensorflow/contrib/session_bundle
parent8f2f9eb49813568b6a7b6a1fa7480e961f7b8c9a (diff)
Replaced calls to tensorflow::StringPiece::ToString with string conversions.
That is, instances of sp.ToString() are replaced with 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: 209806694
Diffstat (limited to 'tensorflow/contrib/session_bundle')
-rw-r--r--tensorflow/contrib/session_bundle/session_bundle.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/tensorflow/contrib/session_bundle/session_bundle.cc b/tensorflow/contrib/session_bundle/session_bundle.cc
index cf26e3cae7..a690d9b129 100644
--- a/tensorflow/contrib/session_bundle/session_bundle.cc
+++ b/tensorflow/contrib/session_bundle/session_bundle.cc
@@ -138,10 +138,10 @@ Status RunRestoreOp(const RunOptions& run_options, const StringPiece export_dir,
Tensor variables_tensor =
CreateStringTensor(GetVariablesFilename(export_dir));
std::vector<std::pair<string, Tensor>> inputs = {
- {variables_filename_const_op_name.ToString(), variables_tensor}};
+ {string(variables_filename_const_op_name), variables_tensor}};
AddAssetsTensorsToInputs(export_dir, asset_files, &inputs);
RunMetadata run_metadata;
- return session->Run(run_options, inputs, {}, {restore_op_name.ToString()},
+ return session->Run(run_options, inputs, {}, {string(restore_op_name)},
nullptr /* outputs */, &run_metadata);
}
@@ -152,7 +152,7 @@ Status RunInitOp(const RunOptions& run_options, const StringPiece export_dir,
std::vector<std::pair<string, Tensor>> inputs;
AddAssetsTensorsToInputs(export_dir, asset_files, &inputs);
RunMetadata run_metadata;
- return session->Run(run_options, inputs, {}, {init_op_name.ToString()},
+ return session->Run(run_options, inputs, {}, {string(init_op_name)},
nullptr /* outputs */, &run_metadata);
}
@@ -251,15 +251,14 @@ Status LoadSessionBundleFromPathUsingRunOptions(const SessionOptions& options,
auto log_and_count = [&](const string& status_str) {
LOG(INFO) << "Loading SessionBundle: " << status_str << ". Took "
<< load_latency_microsecs << " microseconds.";
- load_attempt_count->GetCell(export_dir.ToString(), status_str)
- ->IncrementBy(1);
+ load_attempt_count->GetCell(string(export_dir), status_str)->IncrementBy(1);
};
if (status.ok()) {
log_and_count(kLoadAttemptSuccess);
} else {
log_and_count(kLoadAttemptFail);
}
- load_latency->GetCell(export_dir.ToString())
+ load_latency->GetCell(string(export_dir))
->IncrementBy(load_latency_microsecs);
return status;
}