aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-03-27 12:00:44 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-03-27 12:03:22 -0700
commitfd77211de17bf053cc8f5a82c8eff1818451120c (patch)
tree9375474620e8129f220d741b6407692a06554f70 /tensorflow/cc
parentaec2496567a7bfd508fc487dec474263b6a7481f (diff)
Replaced calls to deprecated tensorflow::StringPiece methods with their
tensorflow::str_util equivalents. This will allow the deprecated methods to be removed. PiperOrigin-RevId: 190650553
Diffstat (limited to 'tensorflow/cc')
-rw-r--r--tensorflow/cc/framework/cc_op_gen_test.cc5
-rw-r--r--tensorflow/cc/framework/scope.cc3
2 files changed, 5 insertions, 3 deletions
diff --git a/tensorflow/cc/framework/cc_op_gen_test.cc b/tensorflow/cc/framework/cc_op_gen_test.cc
index 1e0f2d241b..5d9dfd95a5 100644
--- a/tensorflow/cc/framework/cc_op_gen_test.cc
+++ b/tensorflow/cc/framework/cc_op_gen_test.cc
@@ -19,6 +19,7 @@ limitations under the License.
#include "tensorflow/core/framework/op_gen_lib.h"
#include "tensorflow/core/lib/core/status_test_util.h"
#include "tensorflow/core/lib/io/path.h"
+#include "tensorflow/core/lib/strings/str_util.h"
#include "tensorflow/core/platform/test.h"
namespace tensorflow {
@@ -61,12 +62,12 @@ op {
)";
void ExpectHasSubstr(StringPiece s, StringPiece expected) {
- EXPECT_TRUE(s.contains(expected))
+ EXPECT_TRUE(str_util::StrContains(s, expected))
<< "'" << s << "' does not contain '" << expected << "'";
}
void ExpectDoesNotHaveSubstr(StringPiece s, StringPiece expected) {
- EXPECT_FALSE(s.contains(expected))
+ EXPECT_FALSE(str_util::StrContains(s, expected))
<< "'" << s << "' contains '" << expected << "'";
}
diff --git a/tensorflow/cc/framework/scope.cc b/tensorflow/cc/framework/scope.cc
index 7164249262..c143b97833 100644
--- a/tensorflow/cc/framework/scope.cc
+++ b/tensorflow/cc/framework/scope.cc
@@ -21,6 +21,7 @@ limitations under the License.
#include "tensorflow/core/framework/node_def_util.h"
#include "tensorflow/core/graph/graph_constructor.h"
#include "tensorflow/core/graph/node_builder.h"
+#include "tensorflow/core/lib/strings/str_util.h"
namespace tensorflow {
@@ -218,7 +219,7 @@ std::unordered_set<string> Scope::Impl::GetColocationConstraints(
if (GetNodeAttr(attrs, kColocationAttrName, &node_constraints).ok()) {
for (const string& entry : node_constraints) {
StringPiece s(entry);
- if (s.Consume(kColocationGroupPrefix)) {
+ if (str_util::ConsumePrefix(&s, kColocationGroupPrefix)) {
current_constraints.insert(s.ToString());
}
}