Removing use of DebugString free functions, as MessageLite now implements these methods: 6b3024f693/src/google/protobuf/message_lite.h (L239-L252).

PiperOrigin-RevId: 264735568
This commit is contained in:
Brian Zhao 2019-08-21 18:02:24 -07:00 committed by TensorFlower Gardener
parent 02f3c946f4
commit f92a0e6a9b
44 changed files with 103 additions and 153 deletions

View File

@ -468,7 +468,6 @@ tf_cuda_cc_test(
"//tensorflow/core:math_ops_op_lib",
"//tensorflow/core:nn_ops_op_lib",
"//tensorflow/core:no_op_op_lib",
"//tensorflow/core:proto_text",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:sendrecv_ops_op_lib",
"//tensorflow/core:spectral_ops_op_lib",
@ -590,7 +589,6 @@ tf_cuda_cc_test(
":kernels",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:proto_text",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:test",
"//tensorflow/core:test_main",

View File

@ -29,9 +29,9 @@ limitations under the License.
#include "tensorflow/core/example/feature.pb.h"
#include "tensorflow/core/framework/api_def.pb.h"
#include "tensorflow/core/framework/common_shape_fns.h"
#include "tensorflow/core/framework/graph.pb_text.h"
#include "tensorflow/core/framework/graph.pb.h"
#include "tensorflow/core/framework/kernel_def.pb.h"
#include "tensorflow/core/framework/node_def.pb_text.h"
#include "tensorflow/core/framework/node_def.pb.h"
#include "tensorflow/core/framework/node_def_util.h"
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_def.pb.h"
@ -557,7 +557,7 @@ TEST(CAPI, Graph) {
EXPECT_FALSE(found_add);
found_add = true;
} else {
ADD_FAILURE() << "Unexpected NodeDef: " << ProtoDebugString(n);
ADD_FAILURE() << "Unexpected NodeDef: " << n.DebugString();
}
}
EXPECT_TRUE(found_placeholder);
@ -582,20 +582,20 @@ TEST(CAPI, Graph) {
// Compare with first GraphDef + added NodeDef.
NodeDef* added_node = graph_def.add_node();
*added_node = node_def;
EXPECT_EQ(ProtoDebugString(graph_def), ProtoDebugString(graph_def2));
EXPECT_EQ(graph_def.DebugString(), graph_def2.DebugString());
// Look up some nodes by name.
TF_Operation* neg2 = TF_GraphOperationByName(graph, "neg");
EXPECT_TRUE(neg == neg2);
NodeDef node_def2;
ASSERT_TRUE(GetNodeDef(neg2, &node_def2));
EXPECT_EQ(ProtoDebugString(node_def), ProtoDebugString(node_def2));
EXPECT_EQ(node_def.DebugString(), node_def2.DebugString());
TF_Operation* feed2 = TF_GraphOperationByName(graph, "feed");
EXPECT_TRUE(feed == feed2);
ASSERT_TRUE(GetNodeDef(feed, &node_def));
ASSERT_TRUE(GetNodeDef(feed2, &node_def2));
EXPECT_EQ(ProtoDebugString(node_def), ProtoDebugString(node_def2));
EXPECT_EQ(node_def.DebugString(), node_def2.DebugString());
// Test iterating through the nodes of a graph.
found_placeholder = false;
@ -619,7 +619,7 @@ TEST(CAPI, Graph) {
found_neg = true;
} else {
ASSERT_TRUE(GetNodeDef(oper, &node_def));
ADD_FAILURE() << "Unexpected Node: " << ProtoDebugString(node_def);
ADD_FAILURE() << "Unexpected Node: " << node_def.DebugString();
}
}
EXPECT_TRUE(found_placeholder);

View File

@ -22,7 +22,7 @@ limitations under the License.
#include "tensorflow/c/c_api.h"
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/framework/kernel_def.pb.h"
#include "tensorflow/core/framework/node_def.pb_text.h"
#include "tensorflow/core/framework/node_def.pb.h"
#include "tensorflow/core/framework/node_def_builder.h"
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_kernel.h"

View File

@ -649,7 +649,6 @@ cc_library(
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:op_gen_lib",
"//tensorflow/core:proto_text",
"//tensorflow/core:protos_all_cc",
"@com_google_absl//absl/strings",
],
@ -667,7 +666,6 @@ tf_cc_test(
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:op_gen_lib",
"//tensorflow/core:proto_text",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:test",
"//tensorflow/core:test_main",

View File

@ -27,7 +27,7 @@ limitations under the License.
#include "tensorflow/core/framework/op_gen_lib.h"
#include "tensorflow/core/framework/tensor.pb.h"
#include "tensorflow/core/framework/tensor_shape.pb.h"
#include "tensorflow/core/framework/types.pb_text.h"
#include "tensorflow/core/framework/types.pb.h"
#include "tensorflow/core/lib/gtl/map_util.h"
#include "tensorflow/core/lib/gtl/stl_util.h"
#include "tensorflow/core/lib/hash/hash.h"
@ -198,7 +198,7 @@ string PrintTensor(const TensorProto& tensor_proto) {
return ret;
}
default: {
LOG(FATAL) << "Not handling type " << EnumName_DataType(t.dtype());
LOG(FATAL) << "Not handling type " << DataType_Name(t.dtype());
return string();
}
}
@ -223,7 +223,7 @@ string PrintAttrValue(const string& op, const AttrValue& attr_value) {
case AttrValue::kB:
return attr_value.b() ? "true" : "false";
case AttrValue::kType:
return EnumName_DataType(attr_value.type());
return DataType_Name(attr_value.type());
case AttrValue::kShape:
return PrintTensorShape(attr_value.shape());
case AttrValue::kTensor:
@ -254,8 +254,7 @@ string PrintAttrValue(const string& op, const AttrValue& attr_value) {
} else if (attr_value.list().type_size() > 0) {
for (int i = 0; i < attr_value.list().type_size(); ++i) {
if (i > 0) strings::StrAppend(&ret, ", ");
strings::StrAppend(&ret,
EnumName_DataType(attr_value.list().type(i)));
strings::StrAppend(&ret, DataType_Name(attr_value.list().type(i)));
}
} else if (attr_value.list().shape_size() > 0) {
for (int i = 0; i < attr_value.list().shape_size(); ++i) {

View File

@ -74,7 +74,6 @@ tf_kernel_library(
"//tensorflow/core:framework",
"//tensorflow/core:gpu_headers_lib",
"//tensorflow/core:lib",
"//tensorflow/core:proto_text",
"//tensorflow/core:stream_executor",
],
# TODO: Include? alwayslink = 1,

View File

@ -274,6 +274,22 @@ tf_proto_library(
visibility = ["//visibility:public"],
)
tf_generate_proto_text_sources(
name = "attr_value_proto_text",
srcs = [
"framework/attr_value.proto",
"framework/resource_handle.proto",
"framework/tensor.proto",
"framework/tensor_shape.proto",
"framework/types.proto",
],
srcs_relative_dir = "tensorflow/core/",
deps = [
":lib_internal",
":protos_all_proto_cc",
],
)
tf_jspb_proto_library(
name = "protos_all_jspb_proto",
visibility = ["//visibility:public"],
@ -1767,8 +1783,7 @@ filegroup(
filegroup(
name = "mobile_srcs_no_runtime",
srcs = [
":protos_all_proto_text_srcs",
":error_codes_proto_text_srcs",
":attr_value_proto_text_srcs",
"//tensorflow/core/platform/default/build_config:android_srcs",
"//tensorflow/core/util/ctc:android_srcs",
"//tensorflow/core/platform:legacy_srcs_no_runtime",
@ -2713,17 +2728,6 @@ tf_proto_library(
provide_cc_alias = True,
)
tf_generate_proto_text_sources(
name = "error_codes_proto_text",
srcs = ERROR_CODES_PROTO_SRCS,
protodeps = [],
srcs_relative_dir = "tensorflow/core/",
deps = [
":error_codes_proto_cc",
":lib_internal",
],
)
tf_proto_library(
name = "protos_all_proto",
srcs = COMMON_PROTO_SRCS + ADDITIONAL_CORE_PROTO_SRCS,
@ -2734,32 +2738,6 @@ tf_proto_library(
],
)
tf_generate_proto_text_sources(
name = "protos_all_proto_text",
srcs = COMMON_PROTO_SRCS,
protodeps = ERROR_CODES_PROTO_SRCS,
srcs_relative_dir = "tensorflow/core/",
visibility = ["//visibility:public"],
deps = [
":error_codes_proto_text",
":lib_internal",
":protos_all_proto_cc",
],
)
cc_library(
name = "proto_text",
hdrs = [
":error_codes_proto_text_hdrs",
":protos_all_proto_text_hdrs",
],
deps = [
":lib",
":lib_internal",
":protos_all_cc",
],
)
tf_version_info_genrule()
cc_library(
@ -2920,11 +2898,10 @@ tf_cuda_library(
deps = [
":allocator_registry_impl",
":allocator",
":attr_value_proto_text",
":feature_util",
":lib",
":lib_internal",
":protos_all_proto_text",
":error_codes_proto_text",
":protos_all_cc",
":stats_calculator_portable",
":version_lib",
@ -3066,7 +3043,6 @@ tf_cuda_library(
":framework_internal",
":lib",
":lib_internal",
":proto_text",
":protos_all_cc",
"//third_party/eigen3",
"@com_google_absl//absl/container:flat_hash_map",
@ -3125,7 +3101,6 @@ tf_cuda_library(
":framework_internal",
":lib",
":lib_internal",
":proto_text",
":protos_all_cc",
"@com_google_absl//absl/container:flat_hash_set",
"//third_party/eigen3",
@ -3273,7 +3248,6 @@ tf_cuda_library(
":framework_internal",
":lib",
":lib_internal",
":proto_text",
":protos_all_cc",
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/memory",
@ -3292,7 +3266,6 @@ tf_cuda_library(
hdrs = CORE_CPU_LIB_HEADERS,
deps = [
":core_cpu_base",
":proto_text",
"//tensorflow/core/grappler:grappler_item",
] + if_static([":core_cpu_impl"]) + tf_protos_all() + tf_protos_grappler(),
)
@ -3302,7 +3275,6 @@ tf_cuda_library(
hdrs = CORE_CPU_LIB_HEADERS,
deps = [
":core_cpu_base_no_ops",
":proto_text",
"//tensorflow/core/grappler:grappler_item",
] + tf_protos_all() + tf_protos_grappler(),
)
@ -3320,7 +3292,6 @@ tf_cuda_library(
":framework",
":graph",
":lib",
":proto_text",
":protos_all_cc",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
@ -3400,7 +3371,6 @@ tf_cuda_library(
":lib",
":lib_experimental",
":lib_internal",
":proto_text",
":protos_all_cc",
"//tensorflow/core/debug:debug_graph_utils",
"//tensorflow/core/kernels:function_ops",
@ -3425,7 +3395,6 @@ cc_library(
":framework",
":lib",
":lib_internal",
":proto_text",
":protos_all_cc",
],
alwayslink = 1,
@ -3653,7 +3622,6 @@ cc_library(
":framework_internal",
":lib",
":lib_internal",
":proto_text",
"//third_party/eigen3",
"@local_config_sycl//sycl",
],

View File

@ -34,7 +34,6 @@ limitations under the License.
#include "tensorflow/core/framework/allocator.h"
#include "tensorflow/core/framework/control_flow.h"
#include "tensorflow/core/framework/device_attributes.pb_text.h"
#include "tensorflow/core/framework/device_attributes.pb.h"
#include "tensorflow/core/framework/device_base.h"
#include "tensorflow/core/framework/graph.pb.h"
@ -167,7 +166,7 @@ class Device : public DeviceBase {
virtual ResourceMgr* resource_manager() { return rmgr_; }
// Summarizes the status of this Device, for debugging.
string DebugString() const { return ProtoDebugString(device_attributes_); }
string DebugString() const { return device_attributes_.DebugString(); }
// Assembles the parameter components into a complete DeviceAttributes value.
static DeviceAttributes BuildDeviceAttributes(

View File

@ -38,7 +38,6 @@ limitations under the License.
#include "tensorflow/core/common_runtime/scoped_allocator_mgr.h"
#include "tensorflow/core/common_runtime/step_stats_collector.h"
#include "tensorflow/core/framework/function.h"
#include "tensorflow/core/framework/graph.pb_text.h"
#include "tensorflow/core/framework/graph.pb.h"
#include "tensorflow/core/framework/graph_def_util.h"
#include "tensorflow/core/framework/log_memory.h"

View File

@ -31,7 +31,7 @@ limitations under the License.
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/framework/function.h"
#include "tensorflow/core/framework/function.pb.h"
#include "tensorflow/core/framework/graph.pb_text.h"
#include "tensorflow/core/framework/graph.pb.h"
#include "tensorflow/core/framework/graph_def_util.h"
#include "tensorflow/core/framework/node_def.pb.h"
#include "tensorflow/core/framework/op.h"

View File

@ -22,7 +22,7 @@ limitations under the License.
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/mutex.h"
#include "tensorflow/core/platform/types.h"
#include "tensorflow/core/protobuf/config.pb_text.h"
#include "tensorflow/core/protobuf/config.pb.h"
#include "tensorflow/core/public/session_options.h"
namespace tensorflow {
@ -61,7 +61,7 @@ const string RegisteredFactoriesErrorMessageLocked() {
}
string SessionOptionsToString(const SessionOptions& options) {
return strings::StrCat("target: \"", options.target,
"\" config: ", ProtoShortDebugString(options.config));
"\" config: ", options.config.ShortDebugString());
}
} // namespace

View File

@ -16,9 +16,9 @@ limitations under the License.
#if TENSORFLOW_USE_SYCL
#include "tensorflow/core/common_runtime/sycl/sycl_device.h"
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
#include "tensorflow/core/framework/tensor.pb_text.h"
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
#include "tensorflow/core/framework/tensor.pb.h"
#include "tensorflow/core/platform/tracing.h"
namespace tensorflow {

View File

@ -22,7 +22,7 @@ limitations under the License.
#include "tensorflow/core/framework/allocator_registry.h"
#include "tensorflow/core/framework/device_base.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/tensor.pb_text.h"
#include "tensorflow/core/framework/tensor.pb.h"
#include "tensorflow/core/framework/tensor_util.h"
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/graph/types.h"
@ -100,7 +100,7 @@ Status ThreadPoolDevice::MakeTensorFromProto(
}
}
return errors::InvalidArgument("Cannot parse tensor from proto: ",
ProtoDebugString(tensor_proto));
tensor_proto.DebugString());
}
void ThreadPoolDevice::CopyTensorInSameDevice(

View File

@ -101,7 +101,6 @@ tf_cuda_library(
"//tensorflow/core:graph",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:proto_text",
"//tensorflow/core:protos_all_cc",
],
alwayslink = 1,
@ -124,7 +123,6 @@ tf_cuda_library(
"//tensorflow/core:graph",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:proto_text",
"//tensorflow/core:protos_all_cc",
"@com_google_absl//absl/strings",
],

View File

@ -61,7 +61,6 @@ cc_library(
deps = [
"//tensorflow/core:framework",
"//tensorflow/core:master_proto_cc",
"//tensorflow/core:proto_text",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:worker_proto_cc",
],

View File

@ -22,6 +22,7 @@ limitations under the License.
#include "tensorflow/core/framework/function.h"
#include "tensorflow/core/framework/node_def.pb.h"
#include "tensorflow/core/framework/node_def_builder.h"
#include "tensorflow/core/framework/tensor.pb.h"
#include "tensorflow/core/graph/node_builder.h"
#include "tensorflow/core/lib/gtl/cleanup.h"
#include "tensorflow/core/lib/random/random.h"

View File

@ -34,6 +34,7 @@ limitations under the License.
#include "tensorflow/core/framework/node_def.pb.h"
#include "tensorflow/core/framework/node_def_util.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/tensor.pb.h"
#include "tensorflow/core/framework/tensor_description.pb.h"
#include "tensorflow/core/graph/graph_partition.h"
#include "tensorflow/core/graph/tensor_id.h"

View File

@ -14,8 +14,10 @@ limitations under the License.
==============================================================================*/
#include "tensorflow/core/distributed_runtime/message_wrappers.h"
#include "tensorflow/core/framework/cost_graph.pb.h"
#include "tensorflow/core/framework/step_stats.pb.h"
#include "tensorflow/core/framework/tensor.pb.h"
#include "tensorflow/core/protobuf/config.pb.h"
#include "tensorflow/core/protobuf/named_tensor.pb.h"

View File

@ -21,7 +21,7 @@ limitations under the License.
#include "tensorflow/core/framework/graph.pb.h"
#include "tensorflow/core/framework/step_stats.pb.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/tensor.pb_text.h"
#include "tensorflow/core/framework/tensor.pb.h"
#include "tensorflow/core/framework/versions.pb.h"
#include "tensorflow/core/protobuf/config.pb.h"
#include "tensorflow/core/protobuf/master.pb.h"

View File

@ -26,6 +26,7 @@ limitations under the License.
#include "tensorflow/core/distributed_runtime/rpc/grpc_remote_master.h"
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/framework/node_def.pb.h"
#include "tensorflow/core/framework/tensor.pb.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/strings/str_util.h"
#include "tensorflow/core/platform/mutex.h"

View File

@ -16,7 +16,7 @@ limitations under the License.
#include <vector>
#include "tensorflow/core/example/feature.pb_text.h"
#include "tensorflow/core/example/feature.pb.h"
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/framework/node_def.pb.h"
#include "tensorflow/core/framework/numeric_op.h"

View File

@ -209,7 +209,7 @@ string SummarizeTensor(const TensorProto& tensor_proto) {
Tensor t;
if (!t.FromProto(tensor_proto)) {
return strings::StrCat(
"<Invalid TensorProto: ", ProtoShortDebugString(tensor_proto), ">");
"<Invalid TensorProto: ", tensor_proto.ShortDebugString(), ">");
}
return t.DebugString();
}

View File

@ -26,7 +26,7 @@ limitations under the License.
#include "absl/strings/str_join.h"
#include "tensorflow/core/framework/allocator.h"
#include "tensorflow/core/framework/common_shape_fns.h"
#include "tensorflow/core/framework/function.pb_text.h"
#include "tensorflow/core/framework/function.pb.h"
#include "tensorflow/core/framework/graph.pb.h"
#include "tensorflow/core/framework/node_def.pb.h"
#include "tensorflow/core/framework/node_def_util.h"

View File

@ -26,7 +26,7 @@ limitations under the License.
#include "tensorflow/core/framework/node_def.pb.h"
#include "tensorflow/core/framework/node_def_util.h"
#include "tensorflow/core/framework/op_def_util.h"
#include "tensorflow/core/framework/versions.pb_text.h"
#include "tensorflow/core/framework/versions.pb.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/core/status.h"
#include "tensorflow/core/lib/strings/str_util.h"
@ -37,7 +37,7 @@ namespace tensorflow {
string SummarizeGraphDef(const GraphDef& graph_def) {
string ret;
strings::StrAppend(
&ret, "versions = ", ProtoShortDebugString(graph_def.versions()), ";\n");
&ret, "versions = ", graph_def.versions().ShortDebugString(), ";\n");
for (const NodeDef& node : graph_def.node()) {
strings::StrAppend(&ret, SummarizeNodeDef(node), ";\n");
}

View File

@ -15,7 +15,6 @@ limitations under the License.
#include "tensorflow/core/framework/kernel_def_builder.h"
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/framework/kernel_def.pb_text.h"
#include "tensorflow/core/framework/kernel_def.pb.h"
namespace tensorflow {
@ -132,7 +131,7 @@ KernelDefBuilder& KernelDefBuilder::HostMemory(const char* arg_name) {
KernelDefBuilder& KernelDefBuilder::Label(const char* label) {
CHECK_EQ(kernel_def_->label(), "")
<< "Trying to set a kernel's label a second time: '" << label
<< "' in: " << ProtoShortDebugString(*kernel_def_);
<< "' in: " << kernel_def_->DebugString();
kernel_def_->set_label(label);
return *this;
}

View File

@ -17,7 +17,7 @@ limitations under the License.
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/framework/attr_value_util.h"
#include "tensorflow/core/framework/kernel_def.pb_text.h"
#include "tensorflow/core/framework/kernel_def.pb.h"
#include "tensorflow/core/framework/node_def_util.h"
#include "tensorflow/core/framework/types.h"
@ -39,7 +39,7 @@ Status KernelAttrsMatch(const KernelDef& kernel_def, AttrSlice attrs,
for (const auto& constraint : kernel_def.constraint()) {
if (constraint.allowed_values().list().type_size() == 0) {
return errors::Unimplemented(
"KernelDef '", ProtoShortDebugString(kernel_def),
"KernelDef '", kernel_def.ShortDebugString(),
" has constraint on attr '", constraint.name(),
"' with unsupported type: ",
SummarizeAttrValue(constraint.allowed_values()));
@ -54,7 +54,7 @@ Status KernelAttrsMatch(const KernelDef& kernel_def, AttrSlice attrs,
} else {
if (!AttrValueHasType(*found, "list(type)").ok()) {
return errors::InvalidArgument(
"KernelDef '", ProtoShortDebugString(kernel_def),
"KernelDef '", kernel_def.ShortDebugString(),
"' has constraint on attr '", constraint.name(),
"' that has value '", SummarizeAttrValue(*found),
"' that does not have type 'type' or 'list(type)' in NodeDef "
@ -73,7 +73,7 @@ Status KernelAttrsMatch(const KernelDef& kernel_def, AttrSlice attrs,
return errors::InvalidArgument(
"OpKernel '", kernel_def.op(), "' has constraint on attr '",
constraint.name(), "' not in NodeDef '", attrs.SummarizeNode(),
"', KernelDef: '", ProtoShortDebugString(kernel_def), "'");
"', KernelDef: '", kernel_def.ShortDebugString(), "'");
}
}
*match = true;

View File

@ -15,7 +15,6 @@ limitations under the License.
#include "tensorflow/core/framework/log_memory.h"
#include "tensorflow/core/framework/log_memory.pb_text.h"
#include "tensorflow/core/framework/log_memory.pb.h"
namespace tensorflow {
@ -33,7 +32,7 @@ void OutputToLog(const T& proto) {
const size_t index = type_name.find_last_of(".");
if (index != string::npos) type_name = type_name.substr(index + 1);
LOG(INFO) << LogMemory::kLogMemoryLabel << " " << type_name << " { "
<< ProtoShortDebugString(proto) << " }";
<< proto.ShortDebugString() << " }";
}
} // namespace

View File

@ -23,11 +23,11 @@ limitations under the License.
#include "absl/strings/str_join.h"
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/framework/attr_value_util.h"
#include "tensorflow/core/framework/graph.pb_text.h"
#include "tensorflow/core/framework/graph.pb.h"
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_def.pb_text.h"
#include "tensorflow/core/framework/op_def.pb.h"
#include "tensorflow/core/framework/op_def_util.h"
#include "tensorflow/core/framework/tensor.pb_text.h"
#include "tensorflow/core/framework/tensor.pb.h"
#include "tensorflow/core/framework/tensor_shape.pb.h"
#include "tensorflow/core/graph/graph.h"
#include "tensorflow/core/lib/core/errors.h"
@ -339,7 +339,7 @@ DEFINE_GET_ATTR(PartialTensorShape, shape, "shape", emplace_back,
DEFINE_GET_ATTR(
Tensor, tensor, "tensor", emplace_back, t, Tensor t; if (!t.FromProto(v)) {
return errors::InvalidArgument("Attr ", attr_name, " has value ",
ProtoShortDebugString(v),
v.ShortDebugString(),
" that can't be converted to a Tensor");
})
DEFINE_GET_ATTR(NameAttrList, func, "func", emplace_back, v, ;);
@ -483,7 +483,7 @@ Status AddArgToSig(const NodeDefOrAttrSlice& node_or_attrs,
}
} else {
return errors::InvalidArgument("Missing type or type_attr field in ",
ProtoShortDebugString(arg_def));
arg_def.ShortDebugString());
}
} else if (!arg_def.type_attr().empty()) {
const AttrValue* attr_value;
@ -501,7 +501,7 @@ Status AddArgToSig(const NodeDefOrAttrSlice& node_or_attrs,
sig->push_back(arg_def.type());
} else {
return errors::InvalidArgument("No type fields in ",
ProtoShortDebugString(arg_def));
arg_def.ShortDebugString());
}
if (arg_def.is_ref()) {
// For all types that were added by this function call, make them refs.

View File

@ -18,9 +18,10 @@ limitations under the License.
#include <set>
#include <unordered_map>
#include <unordered_set>
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/framework/attr_value_util.h"
#include "tensorflow/core/framework/op_def.pb_text.h"
#include "tensorflow/core/framework/op_def.pb.h"
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/core/stringpiece.h"
@ -183,12 +184,12 @@ const ApiDef::Arg* FindInputArg(StringPiece name, const ApiDef& api_def) {
return nullptr;
}
#define VALIDATE(EXPR, ...) \
do { \
if (!(EXPR)) { \
return errors::InvalidArgument( \
__VA_ARGS__, "; in OpDef: ", ProtoShortDebugString(op_def)); \
} \
#define VALIDATE(EXPR, ...) \
do { \
if (!(EXPR)) { \
return errors::InvalidArgument( \
__VA_ARGS__, "; in OpDef: ", op_def.ShortDebugString()); \
} \
} while (false)
static Status ValidateArg(const OpDef::ArgDef& arg, const OpDef& op_def,

View File

@ -26,8 +26,8 @@ limitations under the License.
#include "tensorflow/core/framework/allocation_description.pb.h"
#include "tensorflow/core/framework/attr_value_util.h"
#include "tensorflow/core/framework/device_attributes.pb.h"
#include "tensorflow/core/framework/graph.pb_text.h"
#include "tensorflow/core/framework/kernel_def.pb_text.h"
#include "tensorflow/core/framework/graph.pb.h"
#include "tensorflow/core/framework/kernel_def.pb.h"
#include "tensorflow/core/framework/kernel_def_util.h"
#include "tensorflow/core/framework/log_memory.h"
#include "tensorflow/core/framework/memory_types.h"
@ -1248,8 +1248,8 @@ Status FindKernelRegistration(
"Multiple OpKernel registrations match NodeDef '",
FormatNodeDefForError(node_name, has_experimental_debug_info,
experimental_debug_info),
"': '", ProtoShortDebugString((*reg)->def), "' and '",
ProtoShortDebugString(iter->second.def), "'");
"': '", (*reg)->def.ShortDebugString(), "' and '",
iter->second.def.ShortDebugString(), "'");
}
*reg = &iter->second;
} else {
@ -1274,8 +1274,8 @@ Status FindKernelRegistration(
"Multiple Default OpKernel registrations match NodeDef '",
FormatNodeDefForError(node_name, has_experimental_debug_info,
experimental_debug_info),
"': '", ProtoShortDebugString((*reg)->def), "' and '",
ProtoShortDebugString(iter->second.def), "'");
"': '", (*reg)->def.ShortDebugString(), "' and '",
iter->second.def.ShortDebugString(), "'");
}
*reg = &iter->second;
} else {
@ -1424,7 +1424,7 @@ Status SupportedDeviceTypesForNode(
void LogAllRegisteredKernels() {
KernelList kernel_list = GetAllRegisteredKernels();
for (const auto& kernel_def : kernel_list.kernel()) {
LOG(INFO) << "OpKernel ('" << ProtoShortDebugString(kernel_def) << "')";
LOG(INFO) << "OpKernel ('" << kernel_def.ShortDebugString() << "')";
}
}
@ -1572,7 +1572,7 @@ Status ValidateKernelRegistrations(const OpRegistryInterface& op_registry) {
const Status status = op_registry.LookUp(kernel_def.op(), &op_reg_data);
if (!status.ok()) {
// TODO(josh11b): Make this a hard error.
LOG(ERROR) << "OpKernel ('" << ProtoShortDebugString(kernel_def)
LOG(ERROR) << "OpKernel ('" << kernel_def.ShortDebugString()
<< "') for unknown op: " << kernel_def.op();
continue;
}

View File

@ -15,7 +15,7 @@ limitations under the License.
#include "tensorflow/core/framework/shape_inference.h"
#include "tensorflow/core/framework/bounds_check.h"
#include "tensorflow/core/framework/node_def.pb_text.h"
#include "tensorflow/core/framework/node_def.pb.h"
#include "tensorflow/core/framework/partial_tensor_shape.h"
#include "tensorflow/core/framework/tensor_shape.pb.h"
#include "tensorflow/core/lib/core/errors.h"
@ -346,7 +346,7 @@ string InferenceContext::DebugString(DimensionHandle d) {
string InferenceContext::DebugString() const {
return strings::StrCat("InferenceContext for node: ",
ProtoDebugString(*node_def_));
node_def_->DebugString());
}
string InferenceContext::DebugString(const ShapeAndType& shape_and_type) {

View File

@ -18,7 +18,7 @@ limitations under the License.
#ifdef INTEL_MKL
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/types.pb_text.h"
#include "tensorflow/core/framework/types.pb.h"
#include "tensorflow/core/graph/graph.h"
namespace tensorflow {
@ -177,7 +177,7 @@ static inline bool IsMklNameChangeOp(const string& op_name, DataType T) {
// Now we just construct a search string to match what we are looking for.
string search_string = kMklNameChangeOpLabelPattern;
search_string += string(";") + string(" T in [");
search_string += EnumName_DataType(T) + string("]");
search_string += DataType_Name(T) + string("]");
return kernel.find(search_string) != string::npos;
}

View File

@ -919,7 +919,6 @@ ARRAY_DEPS = [
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:proto_text",
"//tensorflow/core:protos_all_cc",
"//third_party/eigen3",
] + if_sycl(["//tensorflow/core:sycl_runtime"])
@ -2429,7 +2428,6 @@ tf_cuda_cc_test(
"//tensorflow/core:core_cpu_internal",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:proto_text",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
@ -4726,7 +4724,6 @@ cc_library(
PARSING_DEPS = [
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:proto_text",
"//tensorflow/core:protos_all_cc",
]

View File

@ -20,7 +20,7 @@ limitations under the License.
#include <vector>
#include "tensorflow/core/example/example.pb.h"
#include "tensorflow/core/example/feature.pb_text.h"
#include "tensorflow/core/example/feature.pb.h"
#include "tensorflow/core/framework/common_shape_fns.h"
#include "tensorflow/core/framework/numeric_op.h"
#include "tensorflow/core/framework/register_types.h"
@ -646,7 +646,7 @@ class ParseSingleSequenceExampleOp : public OpKernel {
errors::InvalidArgument("Name: ", name, ", Context feature: ", key,
". Data types don't match. ",
"Expected type: ", DataTypeString(dtype),
" Feature is: ", ProtoDebugString(f)));
" Feature is: ", f.DebugString()));
OP_REQUIRES_OK(ctx, FeatureDenseCopy(0, name, key, dtype, shape, f,
context_dense_values[d]));
@ -675,7 +675,7 @@ class ParseSingleSequenceExampleOp : public OpKernel {
errors::InvalidArgument("Name: ", name, ", Context feature: ", key,
". Data types don't match. ",
"Expected type: ", DataTypeString(dtype),
" Feature is: ", ProtoDebugString(f)));
" Feature is: ", f.DebugString()));
Tensor feature_values = FeatureSparseCopy(0, key, dtype, f);
const int64 num_elements = feature_values.NumElements();
@ -756,7 +756,7 @@ class ParseSingleSequenceExampleOp : public OpKernel {
"Name: ", name, ", Feature list: ", key, ", Index: ", t,
". Data types don't match. ",
"Expected type: ", DataTypeString(dtype),
" Feature is: ", ProtoDebugString(f)));
" Feature is: ", f.DebugString()));
OP_REQUIRES_OK(ctx, FeatureDenseCopy(t, name, key, dtype, shape, f,
feature_list_dense_values[d]));
}
@ -786,7 +786,7 @@ class ParseSingleSequenceExampleOp : public OpKernel {
", Index: ", t,
". Data types don't match. ",
"Expected type: ", DataTypeString(dtype),
" Feature is: ", ProtoDebugString(f)));
" Feature is: ", f.DebugString()));
sparse_values_tmp.push_back(FeatureSparseCopy(t, key, dtype, f));
}
} else {

View File

@ -19,7 +19,7 @@ limitations under the License.
#include "absl/base/casts.h"
#include "absl/container/flat_hash_map.h"
#include "tensorflow/core/example/example.pb.h"
#include "tensorflow/core/example/feature.pb_text.h"
#include "tensorflow/core/example/feature.pb.h"
#include "tensorflow/core/framework/allocator.h"
#include "tensorflow/core/framework/numeric_op.h"
#include "tensorflow/core/framework/op_kernel.h"

View File

@ -17,7 +17,7 @@ limitations under the License.
#include <vector>
#include "tensorflow/core/example/example.pb.h"
#include "tensorflow/core/example/feature.pb_text.h"
#include "tensorflow/core/example/feature.pb.h"
#include "tensorflow/core/framework/numeric_op.h"
#include "tensorflow/core/framework/register_types.h"
#include "tensorflow/core/lib/core/errors.h"
@ -252,7 +252,7 @@ Status SingleExampleProtoToTensors(
", Feature: ", key,
". Data types don't match. ",
"Expected type: ", DataTypeString(dtype),
" Feature is: ", ProtoDebugString(f));
" Feature is: ", f.DebugString());
}
TF_RETURN_IF_ERROR(FeatureDenseCopy(batch_index, example_name, key, dtype,
shape, f,
@ -284,7 +284,7 @@ Status SingleExampleProtoToTensors(
", Feature: ", key,
". Data types don't match. ",
"Expected type: ", DataTypeString(dtype),
" Feature is: ", ProtoDebugString(f));
" Feature is: ", f.DebugString());
}
(*output_sparse_values_tmp)[d][batch_index] =
FeatureSparseCopy(batch_index, key, dtype, f);

View File

@ -50,7 +50,6 @@ cc_library(
"//tensorflow/core:framework_internal",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:proto_text",
"//tensorflow/core:protos_all_cc",
],
)

View File

@ -23,10 +23,9 @@ limitations under the License.
#include "tensorflow/core/framework/register_types.h"
#include "tensorflow/core/framework/tensor.pb.h"
#include "tensorflow/core/framework/tensor_shape.pb_text.h"
#include "tensorflow/core/framework/tensor_shape.pb.h"
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/framework/types.pb_text.h"
#include "tensorflow/core/framework/types.pb.h"
#include "tensorflow/core/framework/variant.h"
#include "tensorflow/core/framework/variant_op_registry.h"
#include "tensorflow/core/framework/variant_tensor_data.h"
@ -798,7 +797,7 @@ Status BundleReader::GetBundleEntryProto(StringPiece key,
ParseEntryProto(iter_->key(), iter_->value(), &entry_copy));
if (!TensorShape::IsValid(entry_copy.shape())) {
return errors::DataLoss("Invalid tensor shape: ", key, " ",
ProtoShortDebugString(entry_copy.shape()));
entry_copy.shape().ShortDebugString());
}
*entry = entry_copy;
@ -920,7 +919,7 @@ Status BundleReader::ReadCurrent(Tensor* val) {
TF_RETURN_IF_ERROR(ParseEntryProto(iter_->key(), iter_->value(), &entry));
if (!TensorShape::IsValid(entry.shape())) {
return errors::DataLoss("Invalid tensor shape: ", iter_->key(), " ",
ProtoShortDebugString(entry.shape()));
entry.shape().ShortDebugString());
}
if (entry.slices().empty()) {
@ -1095,9 +1094,8 @@ string BundleReader::DebugString() {
CHECK(entry.ParseFromArray(value().data(), value().size()));
if (entry.slices_size() > 0) continue; // Slice of some partitioned var.
strings::StrAppend(&shape_str, key(), " (",
EnumName_DataType(entry.dtype()), ") ",
TensorShape(entry.shape()).DebugString());
strings::StrAppend(&shape_str, key(), " (", DataType_Name(entry.dtype()),
") ", TensorShape(entry.shape()).DebugString());
strings::StrAppend(&shape_str, "\n");
}
return shape_str;

View File

@ -17,7 +17,8 @@ limitations under the License.
#include <utility>
#include <vector>
#include "tensorflow/core/framework/types.pb_text.h"
#include "tensorflow/core/framework/types.pb.h"
#include "tensorflow/core/framework/versions.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/gtl/stl_util.h"
@ -301,7 +302,7 @@ const string TensorSliceReader::DebugString() const {
if (status().ok()) {
for (auto e : Tensors()) {
strings::StrAppend(&shape_str, e.first, " (",
EnumName_DataType(e.second->type()), ") ",
DataType_Name(e.second->type()), ") ",
e.second->shape().DebugString());
// Indicates if a tensor has more than 1 slice (i.e., it's partitioned).
const int num_slices = e.second->Slices().size();

View File

@ -32,7 +32,6 @@ limitations under the License.
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/macros.h"
#include "tensorflow/core/platform/types.h"
#include "tensorflow/core/util/saved_tensor_slice.pb_text.h"
#include "tensorflow/core/util/saved_tensor_slice.pb.h"
#include "tensorflow/core/util/saved_tensor_slice_util.h"
@ -111,7 +110,7 @@ Status TensorSliceWriter::Add(const string& name, const TensorShape& shape,
// The same tensor has been registered -- we verify that the shapes and the
// type agree.
const SavedSliceMeta& ssm = sts_.meta().tensor(index);
CHECK_EQ(name, ssm.name()) << ProtoShortDebugString(ssm);
CHECK_EQ(name, ssm.name()) << ssm.ShortDebugString();
TensorShape ssm_shape(ssm.shape());
if (!shape.IsSameSize(ssm_shape)) {
return errors::Internal(

View File

@ -45,7 +45,6 @@ tf_cc_test(
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:op_gen_lib",
"//tensorflow/core:proto_text",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:test",
"//tensorflow/core:test_main",

View File

@ -598,7 +598,6 @@ cc_library(
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:op_gen_lib",
"//tensorflow/core:proto_text",
"//tensorflow/core:protos_all_cc",
"@com_google_absl//absl/strings",
],

View File

@ -23,11 +23,10 @@ limitations under the License.
#include "tensorflow/core/framework/api_def.pb.h"
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_def.pb_text.h"
#include "tensorflow/core/framework/op_def.pb.h"
#include "tensorflow/core/framework/op_def_util.h"
#include "tensorflow/core/framework/op_gen_lib.h"
#include "tensorflow/core/framework/tensor.pb_text.h"
#include "tensorflow/core/framework/tensor.pb.h"
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/framework/types.pb.h"
#include "tensorflow/core/lib/gtl/map_util.h"
@ -102,7 +101,7 @@ void Unflatten(const string& prefix, const std::vector<string>& output_sizes,
string TensorPBString(const TensorProto& pb) {
// Note: This gets used in the argument list, and so must survive naive
// word wrapping.
return strings::StrCat("\"\"\"", ProtoShortDebugString(pb), "\"\"\"");
return strings::StrCat("\"\"\"", pb.ShortDebugString(), "\"\"\"");
}
class GenEagerPythonOp : public python_op_gen_internal::GenPythonOp {
@ -1078,7 +1077,7 @@ from tensorflow.tools.docs import doc_controls as _doc_controls
)");
result.append("# ");
auto ops_text = ProtoDebugString(cleaned_ops);
auto ops_text = cleaned_ops.DebugString();
absl::StripTrailingAsciiWhitespace(&ops_text);
result.append(str_util::StringReplace(ops_text, "\n", "\n# ", true));
result.append("\n");

View File

@ -26,11 +26,9 @@ limitations under the License.
#include "tensorflow/core/framework/api_def.pb.h"
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_def.pb_text.h"
#include "tensorflow/core/framework/op_def.pb.h"
#include "tensorflow/core/framework/op_def_util.h"
#include "tensorflow/core/framework/op_gen_lib.h"
#include "tensorflow/core/framework/tensor.pb_text.h"
#include "tensorflow/core/framework/tensor.pb.h"
#include "tensorflow/core/framework/tensor_shape.pb.h"
#include "tensorflow/core/framework/types.h"
@ -379,7 +377,7 @@ string ShapeToPython(const TensorShapeProto& shape) {
}
string TensorToPython(const TensorProto& proto) {
return ProtoShortDebugString(proto);
return proto.ShortDebugString();
}
string AttrListToPython(const AttrValue& value,