#include "tensorflow/compiler/xla/legacy_flags/debug_options_flags.h"
#include "tensorflow/core/lib/core/stringpiece.h"
+#include "tensorflow/core/lib/strings/str_util.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/test.h"
#include "tensorflow/core/platform/test_benchmark.h"
// tests.
for (int i = 1; i < argc; i++) {
tensorflow::StringPiece arg(argv[i]);
- if (arg == "--benchmarks" || arg.starts_with("--benchmarks=")) {
+ if (arg == "--benchmarks" ||
+ tensorflow::str_util::StartsWith(arg, "--benchmarks=")) {
const char* pattern = nullptr;
- if (arg.starts_with("--benchmarks=")) {
+ if (tensorflow::str_util::StartsWith(arg, "--benchmarks=")) {
pattern = argv[i] + strlen("--benchmarks=");
} else {
// Handle flag of the form '--benchmarks foo' (no '=').
if (i + 1 >= argc ||
- tensorflow::StringPiece(argv[i + 1]).starts_with("--")) {
+ tensorflow::str_util::StartsWith(argv[i + 1], "--")) {
LOG(ERROR) << "--benchmarks flag requires an argument.";
return 2;
}
output_memory_types_(context->output_memory_types().begin(),
context->output_memory_types().end()),
graph_def_version_(context->graph_def_version()),
- is_internal_(StringPiece(type_string()).starts_with("_")),
+ is_internal_(str_util::StartsWith(type_string(), "_")),
input_name_map_(context->num_inputs()),
output_name_map_(context->num_outputs()) {
OP_REQUIRES_OK(context,
return false;
}
// it must not be created by this stage at any of previous optimization runs
- if (StringPiece(node->name()).contains(stage_name_)) {
+ if (str_util::StrContains(node->name(), stage_name_)) {
return false;
}
// should not drive or be driven by control dependency
return errors::InvalidArgument("S3 path doesn't contain a bucket name: ",
fname);
}
- objectp.Consume("/");
+ str_util::ConsumePrefix(&objectp, "/");
*object = objectp.ToString();
if (!empty_object_ok && object->empty()) {
return errors::InvalidArgument("S3 path doesn't contain an object name: ",