aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-05-02 18:52:02 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-05-02 18:55:37 -0700
commit223be4abe74592a781735a6b66e12cb0146f0830 (patch)
tree40171aa19e37c27169ec94e745354e8020107842 /tensorflow
parent2b1a03c2ad502329a1f2b1368a40913ef21e97a0 (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')
-rw-r--r--tensorflow/cc/framework/cc_op_gen.cc2
-rw-r--r--tensorflow/cc/framework/scope.cc2
-rw-r--r--tensorflow/compiler/tf2xla/tf2xla_util.cc2
-rw-r--r--tensorflow/compiler/tf2xla/xla_op_registry.cc14
-rw-r--r--tensorflow/compiler/xla/service/llvm_ir/llvm_loop.cc4
-rw-r--r--tensorflow/compiler/xla/service/llvm_ir/llvm_loop.h2
-rw-r--r--tensorflow/compiler/xla/tools/parser/hlo_lexer.cc2
-rw-r--r--tensorflow/compiler/xla/tools/parser/hlo_parser.cc2
-rw-r--r--tensorflow/core/debug/debug_graph_utils.cc7
-rw-r--r--tensorflow/core/debug/debug_io_utils.cc10
-rw-r--r--tensorflow/core/distributed_runtime/master_session.cc6
-rw-r--r--tensorflow/core/distributed_runtime/remote_device.cc2
-rw-r--r--tensorflow/core/grappler/utils.h2
-rw-r--r--tensorflow/core/kernels/hexagon/graph_transferer.cc2
-rw-r--r--tensorflow/core/kernels/hexagon/hexagon_control_wrapper.cc2
-rw-r--r--tensorflow/core/lib/io/path.cc6
-rw-r--r--tensorflow/core/lib/io/table_test.cc6
-rw-r--r--tensorflow/core/util/tensor_bundle/tensor_bundle.cc16
-rw-r--r--tensorflow/core/util/tensor_bundle/tensor_bundle_test.cc2
-rw-r--r--tensorflow/stream_executor/kernel.cc2
-rw-r--r--tensorflow/stream_executor/kernel_spec.cc6
21 files changed, 49 insertions, 50 deletions
diff --git a/tensorflow/cc/framework/cc_op_gen.cc b/tensorflow/cc/framework/cc_op_gen.cc
index d73121c7b7..d6a4f141b6 100644
--- a/tensorflow/cc/framework/cc_op_gen.cc
+++ b/tensorflow/cc/framework/cc_op_gen.cc
@@ -440,7 +440,7 @@ string AvoidCPPKeywords(StringPiece name) {
if (IsCPPKeyword(name)) {
return strings::StrCat(name, "_");
}
- return name.ToString();
+ return std::string(name);
}
void InferArgAttributes(const OpDef::ArgDef& arg,
diff --git a/tensorflow/cc/framework/scope.cc b/tensorflow/cc/framework/scope.cc
index c143b97833..62a889181e 100644
--- a/tensorflow/cc/framework/scope.cc
+++ b/tensorflow/cc/framework/scope.cc
@@ -220,7 +220,7 @@ std::unordered_set<string> Scope::Impl::GetColocationConstraints(
for (const string& entry : node_constraints) {
StringPiece s(entry);
if (str_util::ConsumePrefix(&s, kColocationGroupPrefix)) {
- current_constraints.insert(s.ToString());
+ current_constraints.insert(std::string(s));
}
}
} else {
diff --git a/tensorflow/compiler/tf2xla/tf2xla_util.cc b/tensorflow/compiler/tf2xla/tf2xla_util.cc
index 7ec85aa3cd..9203e8d9e6 100644
--- a/tensorflow/compiler/tf2xla/tf2xla_util.cc
+++ b/tensorflow/compiler/tf2xla/tf2xla_util.cc
@@ -232,7 +232,7 @@ Status PruneGraphDefInto(const tf2xla::Config& config, const GraphDef& in,
// Push input nodes of the currently visited node to name_queue.
for (const string& in_edge : map_entry.second->input()) {
auto id = ParseTensorName(in_edge);
- const string node_name = id.first.ToString();
+ const string node_name = std::string(id.first);
if (feed_tensors.find(std::make_pair(node_name, id.second)) ==
feed_tensors.end()) {
name_queue.push(node_name);
diff --git a/tensorflow/compiler/tf2xla/xla_op_registry.cc b/tensorflow/compiler/tf2xla/xla_op_registry.cc
index bbe808595d..e309cb1e34 100644
--- a/tensorflow/compiler/tf2xla/xla_op_registry.cc
+++ b/tensorflow/compiler/tf2xla/xla_op_registry.cc
@@ -311,7 +311,7 @@ XlaOpRegistry& XlaOpRegistry::Instance() {
XlaOpRegistrationBuilder::XlaOpRegistrationBuilder(StringPiece name) {
registration_.reset(new XlaOpRegistry::OpRegistration);
- registration_->name = name.ToString();
+ registration_->name = std::string(name);
}
XlaOpRegistrationBuilder XlaOpRegistrationBuilder::Name(StringPiece name) {
@@ -323,14 +323,14 @@ XlaOpRegistrationBuilder& XlaOpRegistrationBuilder::Device(
gtl::ArraySlice<StringPiece> devices) {
registration_->has_device_whitelist = true;
for (StringPiece device : devices) {
- registration_->device_whitelist.insert(device.ToString());
+ registration_->device_whitelist.insert(std::string(device));
}
return *this;
}
XlaOpRegistrationBuilder& XlaOpRegistrationBuilder::Device(StringPiece device) {
registration_->has_device_whitelist = true;
- registration_->device_whitelist.insert(device.ToString());
+ registration_->device_whitelist.insert(std::string(device));
return *this;
}
@@ -347,7 +347,7 @@ XlaOpRegistrationBuilder& XlaOpRegistrationBuilder::AllowResourceTypes() {
XlaOpRegistrationBuilder& XlaOpRegistrationBuilder::TypeConstraint(
StringPiece attr_name, DataType allowed) {
std::set<DataType>& types =
- registration_->type_constraints[attr_name.ToString()];
+ registration_->type_constraints[std::string(attr_name)];
types.insert(allowed);
return *this;
}
@@ -355,7 +355,7 @@ XlaOpRegistrationBuilder& XlaOpRegistrationBuilder::TypeConstraint(
XlaOpRegistrationBuilder& XlaOpRegistrationBuilder::TypeConstraint(
StringPiece attr_name, gtl::ArraySlice<DataType> allowed) {
std::set<DataType>& types =
- registration_->type_constraints[attr_name.ToString()];
+ registration_->type_constraints[std::string(attr_name)];
for (DataType t : allowed) {
types.insert(t);
}
@@ -364,7 +364,7 @@ XlaOpRegistrationBuilder& XlaOpRegistrationBuilder::TypeConstraint(
XlaOpRegistrationBuilder& XlaOpRegistrationBuilder::CompileTimeConstInput(
StringPiece input_name) {
- registration_->compile_time_constant_inputs.insert(input_name.ToString());
+ registration_->compile_time_constant_inputs.insert(std::string(input_name));
return *this;
}
@@ -394,7 +394,7 @@ XlaBackendRegistrar::XlaBackendRegistrar(
StringPiece name, gtl::ArraySlice<DataType> types,
XlaOpRegistry::BackendOpFilter op_filter) {
XlaOpRegistry& registry = XlaOpRegistry::Instance();
- registry.RegisterBackend(name.ToString(), types, op_filter);
+ registry.RegisterBackend(std::string(name), types, op_filter);
}
} // namespace tensorflow
diff --git a/tensorflow/compiler/xla/service/llvm_ir/llvm_loop.cc b/tensorflow/compiler/xla/service/llvm_ir/llvm_loop.cc
index 7b227ce294..497b48ff22 100644
--- a/tensorflow/compiler/xla/service/llvm_ir/llvm_loop.cc
+++ b/tensorflow/compiler/xla/service/llvm_ir/llvm_loop.cc
@@ -36,8 +36,8 @@ ForLoop::ForLoop(tensorflow::StringPiece prefix, tensorflow::StringPiece suffix,
llvm::Value* start_index, llvm::Value* end_index,
llvm::Value* step, bool prevent_unrolling,
bool prevent_vectorization)
- : prefix_(prefix.ToString()),
- suffix_(suffix.ToString()),
+ : prefix_(std::string(prefix)),
+ suffix_(std::string(suffix)),
start_index_(start_index),
end_index_(end_index),
step_(step),
diff --git a/tensorflow/compiler/xla/service/llvm_ir/llvm_loop.h b/tensorflow/compiler/xla/service/llvm_ir/llvm_loop.h
index 20069ce5a2..d915f95db1 100644
--- a/tensorflow/compiler/xla/service/llvm_ir/llvm_loop.h
+++ b/tensorflow/compiler/xla/service/llvm_ir/llvm_loop.h
@@ -174,7 +174,7 @@ class ForLoopNest {
: ForLoopNest(/*name=*/"", ir_builder) {}
ForLoopNest(tensorflow::StringPiece name, llvm::IRBuilder<>* ir_builder)
- : name_(name.ToString()),
+ : name_(std::string(name)),
outer_loop_preheader_bb_(nullptr),
outer_loop_exit_bb_(nullptr),
inner_loop_body_bb_(nullptr),
diff --git a/tensorflow/compiler/xla/tools/parser/hlo_lexer.cc b/tensorflow/compiler/xla/tools/parser/hlo_lexer.cc
index fc0e444452..350db12653 100644
--- a/tensorflow/compiler/xla/tools/parser/hlo_lexer.cc
+++ b/tensorflow/compiler/xla/tools/parser/hlo_lexer.cc
@@ -230,7 +230,7 @@ TokKind HloLexer::LexIdentifier() {
}
}
- str_val_ = identifier.ToString();
+ str_val_ = std::string(identifier);
return TokKind::kIdent;
}
diff --git a/tensorflow/compiler/xla/tools/parser/hlo_parser.cc b/tensorflow/compiler/xla/tools/parser/hlo_parser.cc
index 1bb31ddb7b..3a945fb3b1 100644
--- a/tensorflow/compiler/xla/tools/parser/hlo_parser.cc
+++ b/tensorflow/compiler/xla/tools/parser/hlo_parser.cc
@@ -242,7 +242,7 @@ bool HloParser::Error(LocTy loc, StringPiece msg) {
std::vector<string> error_lines;
error_lines.push_back(
StrCat("was parsing ", line, ":", col, ": error: ", msg));
- error_lines.push_back(lexer_.GetLine(loc).ToString());
+ error_lines.push_back(std::string(lexer_.GetLine(loc)));
error_lines.push_back(col == 0 ? "" : StrCat(string(col - 1, ' '), "^"));
error_.push_back(tensorflow::str_util::Join(error_lines, "\n"));
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
diff --git a/tensorflow/core/distributed_runtime/master_session.cc b/tensorflow/core/distributed_runtime/master_session.cc
index 83afc5b1a4..08fbe8b144 100644
--- a/tensorflow/core/distributed_runtime/master_session.cc
+++ b/tensorflow/core/distributed_runtime/master_session.cc
@@ -606,7 +606,7 @@ Status MasterSession::ReffedClientGraph::RunPartitionsHelper(
// inadvertently slowing down the normal run path.
if (is_partial_) {
for (const auto& name_index : feeds) {
- const auto iter = part.feed_key.find(name_index.first.ToString());
+ const auto iter = part.feed_key.find(std::string(name_index.first));
if (iter == part.feed_key.end()) {
// The provided feed must be for a different partition.
continue;
@@ -950,7 +950,7 @@ Status MasterSession::ReffedClientGraph::CheckFetches(
// Skip if already fed.
if (input.second) continue;
TensorId id(ParseTensorName(input.first));
- const Node* n = execution_state->get_node_by_name(id.first.ToString());
+ const Node* n = execution_state->get_node_by_name(std::string(id.first));
if (n == nullptr) {
return errors::NotFound("Feed ", input.first, ": not found");
}
@@ -966,7 +966,7 @@ Status MasterSession::ReffedClientGraph::CheckFetches(
for (size_t i = 0; i < req.num_fetches(); ++i) {
const string& fetch = req.fetch_name(i);
const TensorId id(ParseTensorName(fetch));
- const Node* n = execution_state->get_node_by_name(id.first.ToString());
+ const Node* n = execution_state->get_node_by_name(std::string(id.first));
if (n == nullptr) {
return errors::NotFound("Fetch ", fetch, ": not found");
}
diff --git a/tensorflow/core/distributed_runtime/remote_device.cc b/tensorflow/core/distributed_runtime/remote_device.cc
index ec26ac44b5..15e5919c54 100644
--- a/tensorflow/core/distributed_runtime/remote_device.cc
+++ b/tensorflow/core/distributed_runtime/remote_device.cc
@@ -37,7 +37,7 @@ string GetLocalDeviceName(StringPiece fullname) {
auto pos = fullname.rfind('/');
CHECK_NE(pos, StringPiece::npos);
fullname.remove_prefix(pos + 1);
- return fullname.ToString();
+ return std::string(fullname);
}
class RemoteDevice : public Device {
diff --git a/tensorflow/core/grappler/utils.h b/tensorflow/core/grappler/utils.h
index 9776e99f20..b87ae05546 100644
--- a/tensorflow/core/grappler/utils.h
+++ b/tensorflow/core/grappler/utils.h
@@ -139,7 +139,7 @@ inline StringPiece ParseNodeNameAsStringPiece(const string& name,
// Returns the node name and position in a single call.
inline string ParseNodeName(const string& name, int* position) {
- return ParseNodeNameAsStringPiece(name, position).ToString();
+ return std::string(ParseNodeNameAsStringPiece(name, position));
}
// Add a prefix to a node name with a custom delimiter.
diff --git a/tensorflow/core/kernels/hexagon/graph_transferer.cc b/tensorflow/core/kernels/hexagon/graph_transferer.cc
index 7960cb4b05..e05de3fe8e 100644
--- a/tensorflow/core/kernels/hexagon/graph_transferer.cc
+++ b/tensorflow/core/kernels/hexagon/graph_transferer.cc
@@ -161,7 +161,7 @@ Status GraphTransferer::LoadGraphFromProto(
for (const string& output_node_name : output_node_names) {
const TensorId tid = ParseTensorName(output_node_name);
- const string node_name = tid.first.ToString();
+ const string node_name = std::string(tid.first);
const int port = tid.second;
const int node_id = node_name_to_id_cache_map_.at(node_name);
const Node* node = node_name_cache_list_.at(node_id);
diff --git a/tensorflow/core/kernels/hexagon/hexagon_control_wrapper.cc b/tensorflow/core/kernels/hexagon/hexagon_control_wrapper.cc
index 3810cbe5b5..1580b72605 100644
--- a/tensorflow/core/kernels/hexagon/hexagon_control_wrapper.cc
+++ b/tensorflow/core/kernels/hexagon/hexagon_control_wrapper.cc
@@ -168,7 +168,7 @@ bool HexagonControlWrapper::SetupGraph() {
new_output_node_info.set_output_count(0);
const TensorId tid = ParseTensorName(graph_output.name());
- const string node_name = tid.first.ToString();
+ const string node_name = std::string(tid.first);
const int port = tid.second;
// Register node input for the new output node
const GraphTransferNodeInfo* node_info =
diff --git a/tensorflow/core/lib/io/path.cc b/tensorflow/core/lib/io/path.cc
index 996fbf62e5..b62206012c 100644
--- a/tensorflow/core/lib/io/path.cc
+++ b/tensorflow/core/lib/io/path.cc
@@ -42,7 +42,7 @@ string JoinPathImpl(std::initializer_list<StringPiece> paths) {
if (path.empty()) continue;
if (result.empty()) {
- result = path.ToString();
+ result = std::string(path);
continue;
}
@@ -124,7 +124,7 @@ StringPiece Extension(StringPiece path) {
}
string CleanPath(StringPiece unclean_path) {
- string path = unclean_path.ToString();
+ string path = std::string(unclean_path);
const char* src = path.c_str();
string::iterator dst = path.begin();
@@ -237,7 +237,7 @@ void ParseURI(StringPiece remaining, StringPiece* scheme, StringPiece* host,
string CreateURI(StringPiece scheme, StringPiece host, StringPiece path) {
if (scheme.empty()) {
- return path.ToString();
+ return std::string(path);
}
return strings::StrCat(scheme, "://", host, path);
}
diff --git a/tensorflow/core/lib/io/table_test.cc b/tensorflow/core/lib/io/table_test.cc
index 78a3fa501c..9e3309f0a7 100644
--- a/tensorflow/core/lib/io/table_test.cc
+++ b/tensorflow/core/lib/io/table_test.cc
@@ -147,7 +147,7 @@ class Constructor {
virtual ~Constructor() {}
void Add(const string& key, const StringPiece& value) {
- data_[key] = value.ToString();
+ data_[key] = std::string(value);
}
// Finish constructing the data structure with all the keys that have
@@ -188,7 +188,7 @@ class BlockConstructor : public Constructor {
builder.Add(it->first, it->second);
}
// Open the block
- data_ = builder.Finish().ToString();
+ data_ = std::string(builder.Finish());
BlockContents contents;
contents.data = data_;
contents.cachable = false;
@@ -515,7 +515,7 @@ TEST_F(Harness, Randomized) {
for (int e = 0; e < num_entries; e++) {
string v;
Add(test::RandomKey(&rnd, rnd.Skewed(4)),
- test::RandomString(&rnd, rnd.Skewed(5), &v).ToString());
+ std::string(test::RandomString(&rnd, rnd.Skewed(5), &v)));
}
Test(&rnd);
}
diff --git a/tensorflow/core/util/tensor_bundle/tensor_bundle.cc b/tensorflow/core/util/tensor_bundle/tensor_bundle.cc
index 0426fee0e2..7190614706 100644
--- a/tensorflow/core/util/tensor_bundle/tensor_bundle.cc
+++ b/tensorflow/core/util/tensor_bundle/tensor_bundle.cc
@@ -370,14 +370,14 @@ Status PadAlignment(FileOutputBuffer* out, int alignment, int64* size) {
BundleWriter::BundleWriter(Env* env, StringPiece prefix, const Options& options)
: env_(env),
options_(options),
- prefix_(prefix.ToString()),
+ prefix_(std::string(prefix)),
tmp_metadata_path_(strings::StrCat(MetaFilename(prefix_), ".tempstate",
random::New64())),
tmp_data_path_(strings::StrCat(DataFilename(prefix_, 0, 1), ".tempstate",
random::New64())),
out_(nullptr),
size_(0) {
- status_ = env_->CreateDir(io::Dirname(prefix_).ToString());
+ status_ = env_->CreateDir(std::string(io::Dirname(prefix_)));
if (!status_.ok() && !errors::IsAlreadyExists(status_)) {
return;
}
@@ -394,7 +394,7 @@ BundleWriter::BundleWriter(Env* env, StringPiece prefix, const Options& options)
Status BundleWriter::Add(StringPiece key, const Tensor& val) {
if (!status_.ok()) return status_;
CHECK_NE(key, kHeaderEntryKey);
- const string key_string = key.ToString();
+ const string key_string = std::string(key);
if (entries_.find(key_string) != entries_.end()) {
status_ = errors::InvalidArgument("Adding duplicate key: ", key);
return status_;
@@ -445,7 +445,7 @@ Status BundleWriter::AddSlice(StringPiece full_tensor_key,
// In the case of a sharded save, MergeBundles() is responsible for merging
// the "slices" field of multiple metadata entries corresponding to the same
// full tensor.
- const string full_tensor_key_string = full_tensor_key.ToString();
+ const string full_tensor_key_string = std::string(full_tensor_key);
BundleEntryProto* full_entry = &entries_[full_tensor_key_string];
if (full_entry->dtype() != DT_INVALID) {
CHECK_EQ(full_entry->dtype(), slice_tensor.dtype());
@@ -600,7 +600,7 @@ static Status MergeOneBundle(Env* env, StringPiece prefix,
// Loops through the non-header to-merge entries.
BundleEntryProto to_merge_entry;
for (; iter->Valid(); iter->Next()) {
- const string key = iter->key().ToString();
+ const string key = std::string(iter->key());
const auto entry_iter = merge_state->entries.find(key);
// Illegal: the duplicated entry is a non-slice tensor.
@@ -649,7 +649,7 @@ Status MergeBundles(Env* env, gtl::ArraySlice<string> prefixes,
// Merges all metadata tables.
// TODO(zhifengc): KeyValue sorter if it becomes too big.
MergeState merge;
- Status status = env->CreateDir(io::Dirname(merged_prefix).ToString());
+ Status status = env->CreateDir(std::string(io::Dirname(merged_prefix)));
if (!status.ok() && !errors::IsAlreadyExists(status)) return status;
for (int i = 0; i < prefixes.size(); ++i) {
TF_RETURN_IF_ERROR(MergeOneBundle(env, prefixes[i], &merge));
@@ -697,7 +697,7 @@ Status MergeBundles(Env* env, gtl::ArraySlice<string> prefixes,
BundleReader::BundleReader(Env* env, StringPiece prefix)
: env_(env),
- prefix_(prefix.ToString()),
+ prefix_(std::string(prefix)),
metadata_(nullptr),
table_(nullptr),
iter_(nullptr) {
@@ -919,7 +919,7 @@ Status BundleReader::GetSliceValue(StringPiece full_tensor_key,
const TensorShape full_shape(TensorShape(full_tensor_entry.shape()));
std::vector<std::pair<TensorSlice, string>> details;
- const string full_tensor_key_string = full_tensor_key.ToString();
+ const string full_tensor_key_string = std::string(full_tensor_key);
const TensorSliceSet* tss =
gtl::FindPtrOrNull(tensor_slices_, full_tensor_key_string);
diff --git a/tensorflow/core/util/tensor_bundle/tensor_bundle_test.cc b/tensorflow/core/util/tensor_bundle/tensor_bundle_test.cc
index 7f166f0ec0..92ce8ae00e 100644
--- a/tensorflow/core/util/tensor_bundle/tensor_bundle_test.cc
+++ b/tensorflow/core/util/tensor_bundle/tensor_bundle_test.cc
@@ -107,7 +107,7 @@ std::vector<string> AllTensorKeys(BundleReader* reader) {
reader->Seek(kHeaderEntryKey);
reader->Next();
for (; reader->Valid(); reader->Next()) {
- ret.push_back(reader->key().ToString());
+ ret.push_back(std::string(reader->key()));
}
return ret;
}
diff --git a/tensorflow/stream_executor/kernel.cc b/tensorflow/stream_executor/kernel.cc
index d1aa596b73..7c1923da51 100644
--- a/tensorflow/stream_executor/kernel.cc
+++ b/tensorflow/stream_executor/kernel.cc
@@ -94,7 +94,7 @@ KernelCacheConfig KernelBase::GetPreferredCacheConfig() const {
static const char *kStubPrefix = "__device_stub_";
void KernelBase::set_name(port::StringPiece name) {
- name_ = name.ToString();
+ name_ = std::string(name);
port::StringPiece stubless_name = name;
if (tensorflow::str_util::StartsWith(name, kStubPrefix)) {
stubless_name.remove_prefix(strlen(kStubPrefix));
diff --git a/tensorflow/stream_executor/kernel_spec.cc b/tensorflow/stream_executor/kernel_spec.cc
index 6a1f0a591f..f0a5785b72 100644
--- a/tensorflow/stream_executor/kernel_spec.cc
+++ b/tensorflow/stream_executor/kernel_spec.cc
@@ -18,11 +18,11 @@ limitations under the License.
namespace stream_executor {
KernelLoaderSpec::KernelLoaderSpec(port::StringPiece kernelname)
- : kernelname_(kernelname.ToString()) {}
+ : kernelname_(std::string(kernelname)) {}
OnDiskKernelLoaderSpec::OnDiskKernelLoaderSpec(port::StringPiece filename,
port::StringPiece kernelname)
- : KernelLoaderSpec(kernelname), filename_(filename.ToString()) {}
+ : KernelLoaderSpec(kernelname), filename_(std::string(filename)) {}
CudaPtxOnDisk::CudaPtxOnDisk(port::StringPiece filename,
port::StringPiece kernelname)
@@ -161,7 +161,7 @@ OpenCLTextOnDisk::OpenCLTextOnDisk(port::StringPiece filename,
OpenCLTextInMemory::OpenCLTextInMemory(port::StringPiece text,
port::StringPiece kernelname)
- : KernelLoaderSpec(kernelname), text_(text.ToString()) {}
+ : KernelLoaderSpec(kernelname), text_(std::string(text)) {}
OpenCLBinaryOnDisk::OpenCLBinaryOnDisk(port::StringPiece filename,
port::StringPiece kernelname)