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:
parent
02f3c946f4
commit
f92a0e6a9b
@ -468,7 +468,6 @@ tf_cuda_cc_test(
|
|||||||
"//tensorflow/core:math_ops_op_lib",
|
"//tensorflow/core:math_ops_op_lib",
|
||||||
"//tensorflow/core:nn_ops_op_lib",
|
"//tensorflow/core:nn_ops_op_lib",
|
||||||
"//tensorflow/core:no_op_op_lib",
|
"//tensorflow/core:no_op_op_lib",
|
||||||
"//tensorflow/core:proto_text",
|
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
"//tensorflow/core:sendrecv_ops_op_lib",
|
"//tensorflow/core:sendrecv_ops_op_lib",
|
||||||
"//tensorflow/core:spectral_ops_op_lib",
|
"//tensorflow/core:spectral_ops_op_lib",
|
||||||
@ -590,7 +589,6 @@ tf_cuda_cc_test(
|
|||||||
":kernels",
|
":kernels",
|
||||||
"//tensorflow/core:framework",
|
"//tensorflow/core:framework",
|
||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
"//tensorflow/core:proto_text",
|
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
"//tensorflow/core:test",
|
"//tensorflow/core:test",
|
||||||
"//tensorflow/core:test_main",
|
"//tensorflow/core:test_main",
|
||||||
|
@ -29,9 +29,9 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/example/feature.pb.h"
|
#include "tensorflow/core/example/feature.pb.h"
|
||||||
#include "tensorflow/core/framework/api_def.pb.h"
|
#include "tensorflow/core/framework/api_def.pb.h"
|
||||||
#include "tensorflow/core/framework/common_shape_fns.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/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/node_def_util.h"
|
||||||
#include "tensorflow/core/framework/op.h"
|
#include "tensorflow/core/framework/op.h"
|
||||||
#include "tensorflow/core/framework/op_def.pb.h"
|
#include "tensorflow/core/framework/op_def.pb.h"
|
||||||
@ -557,7 +557,7 @@ TEST(CAPI, Graph) {
|
|||||||
EXPECT_FALSE(found_add);
|
EXPECT_FALSE(found_add);
|
||||||
found_add = true;
|
found_add = true;
|
||||||
} else {
|
} else {
|
||||||
ADD_FAILURE() << "Unexpected NodeDef: " << ProtoDebugString(n);
|
ADD_FAILURE() << "Unexpected NodeDef: " << n.DebugString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXPECT_TRUE(found_placeholder);
|
EXPECT_TRUE(found_placeholder);
|
||||||
@ -582,20 +582,20 @@ TEST(CAPI, Graph) {
|
|||||||
// Compare with first GraphDef + added NodeDef.
|
// Compare with first GraphDef + added NodeDef.
|
||||||
NodeDef* added_node = graph_def.add_node();
|
NodeDef* added_node = graph_def.add_node();
|
||||||
*added_node = node_def;
|
*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.
|
// Look up some nodes by name.
|
||||||
TF_Operation* neg2 = TF_GraphOperationByName(graph, "neg");
|
TF_Operation* neg2 = TF_GraphOperationByName(graph, "neg");
|
||||||
EXPECT_TRUE(neg == neg2);
|
EXPECT_TRUE(neg == neg2);
|
||||||
NodeDef node_def2;
|
NodeDef node_def2;
|
||||||
ASSERT_TRUE(GetNodeDef(neg2, &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");
|
TF_Operation* feed2 = TF_GraphOperationByName(graph, "feed");
|
||||||
EXPECT_TRUE(feed == feed2);
|
EXPECT_TRUE(feed == feed2);
|
||||||
ASSERT_TRUE(GetNodeDef(feed, &node_def));
|
ASSERT_TRUE(GetNodeDef(feed, &node_def));
|
||||||
ASSERT_TRUE(GetNodeDef(feed2, &node_def2));
|
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.
|
// Test iterating through the nodes of a graph.
|
||||||
found_placeholder = false;
|
found_placeholder = false;
|
||||||
@ -619,7 +619,7 @@ TEST(CAPI, Graph) {
|
|||||||
found_neg = true;
|
found_neg = true;
|
||||||
} else {
|
} else {
|
||||||
ASSERT_TRUE(GetNodeDef(oper, &node_def));
|
ASSERT_TRUE(GetNodeDef(oper, &node_def));
|
||||||
ADD_FAILURE() << "Unexpected Node: " << ProtoDebugString(node_def);
|
ADD_FAILURE() << "Unexpected Node: " << node_def.DebugString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXPECT_TRUE(found_placeholder);
|
EXPECT_TRUE(found_placeholder);
|
||||||
|
@ -22,7 +22,7 @@ limitations under the License.
|
|||||||
#include "tensorflow/c/c_api.h"
|
#include "tensorflow/c/c_api.h"
|
||||||
#include "tensorflow/core/framework/attr_value.pb.h"
|
#include "tensorflow/core/framework/attr_value.pb.h"
|
||||||
#include "tensorflow/core/framework/kernel_def.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/node_def_builder.h"
|
||||||
#include "tensorflow/core/framework/op.h"
|
#include "tensorflow/core/framework/op.h"
|
||||||
#include "tensorflow/core/framework/op_kernel.h"
|
#include "tensorflow/core/framework/op_kernel.h"
|
||||||
|
@ -649,7 +649,6 @@ cc_library(
|
|||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
"//tensorflow/core:lib_internal",
|
"//tensorflow/core:lib_internal",
|
||||||
"//tensorflow/core:op_gen_lib",
|
"//tensorflow/core:op_gen_lib",
|
||||||
"//tensorflow/core:proto_text",
|
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
"@com_google_absl//absl/strings",
|
"@com_google_absl//absl/strings",
|
||||||
],
|
],
|
||||||
@ -667,7 +666,6 @@ tf_cc_test(
|
|||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
"//tensorflow/core:lib_internal",
|
"//tensorflow/core:lib_internal",
|
||||||
"//tensorflow/core:op_gen_lib",
|
"//tensorflow/core:op_gen_lib",
|
||||||
"//tensorflow/core:proto_text",
|
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
"//tensorflow/core:test",
|
"//tensorflow/core:test",
|
||||||
"//tensorflow/core:test_main",
|
"//tensorflow/core:test_main",
|
||||||
|
@ -27,7 +27,7 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/framework/op_gen_lib.h"
|
#include "tensorflow/core/framework/op_gen_lib.h"
|
||||||
#include "tensorflow/core/framework/tensor.pb.h"
|
#include "tensorflow/core/framework/tensor.pb.h"
|
||||||
#include "tensorflow/core/framework/tensor_shape.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/map_util.h"
|
||||||
#include "tensorflow/core/lib/gtl/stl_util.h"
|
#include "tensorflow/core/lib/gtl/stl_util.h"
|
||||||
#include "tensorflow/core/lib/hash/hash.h"
|
#include "tensorflow/core/lib/hash/hash.h"
|
||||||
@ -198,7 +198,7 @@ string PrintTensor(const TensorProto& tensor_proto) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
LOG(FATAL) << "Not handling type " << EnumName_DataType(t.dtype());
|
LOG(FATAL) << "Not handling type " << DataType_Name(t.dtype());
|
||||||
return string();
|
return string();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -223,7 +223,7 @@ string PrintAttrValue(const string& op, const AttrValue& attr_value) {
|
|||||||
case AttrValue::kB:
|
case AttrValue::kB:
|
||||||
return attr_value.b() ? "true" : "false";
|
return attr_value.b() ? "true" : "false";
|
||||||
case AttrValue::kType:
|
case AttrValue::kType:
|
||||||
return EnumName_DataType(attr_value.type());
|
return DataType_Name(attr_value.type());
|
||||||
case AttrValue::kShape:
|
case AttrValue::kShape:
|
||||||
return PrintTensorShape(attr_value.shape());
|
return PrintTensorShape(attr_value.shape());
|
||||||
case AttrValue::kTensor:
|
case AttrValue::kTensor:
|
||||||
@ -254,8 +254,7 @@ string PrintAttrValue(const string& op, const AttrValue& attr_value) {
|
|||||||
} else if (attr_value.list().type_size() > 0) {
|
} else if (attr_value.list().type_size() > 0) {
|
||||||
for (int i = 0; i < attr_value.list().type_size(); ++i) {
|
for (int i = 0; i < attr_value.list().type_size(); ++i) {
|
||||||
if (i > 0) strings::StrAppend(&ret, ", ");
|
if (i > 0) strings::StrAppend(&ret, ", ");
|
||||||
strings::StrAppend(&ret,
|
strings::StrAppend(&ret, DataType_Name(attr_value.list().type(i)));
|
||||||
EnumName_DataType(attr_value.list().type(i)));
|
|
||||||
}
|
}
|
||||||
} else if (attr_value.list().shape_size() > 0) {
|
} else if (attr_value.list().shape_size() > 0) {
|
||||||
for (int i = 0; i < attr_value.list().shape_size(); ++i) {
|
for (int i = 0; i < attr_value.list().shape_size(); ++i) {
|
||||||
|
@ -74,7 +74,6 @@ tf_kernel_library(
|
|||||||
"//tensorflow/core:framework",
|
"//tensorflow/core:framework",
|
||||||
"//tensorflow/core:gpu_headers_lib",
|
"//tensorflow/core:gpu_headers_lib",
|
||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
"//tensorflow/core:proto_text",
|
|
||||||
"//tensorflow/core:stream_executor",
|
"//tensorflow/core:stream_executor",
|
||||||
],
|
],
|
||||||
# TODO: Include? alwayslink = 1,
|
# TODO: Include? alwayslink = 1,
|
||||||
|
@ -274,6 +274,22 @@ tf_proto_library(
|
|||||||
visibility = ["//visibility:public"],
|
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(
|
tf_jspb_proto_library(
|
||||||
name = "protos_all_jspb_proto",
|
name = "protos_all_jspb_proto",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
@ -1767,8 +1783,7 @@ filegroup(
|
|||||||
filegroup(
|
filegroup(
|
||||||
name = "mobile_srcs_no_runtime",
|
name = "mobile_srcs_no_runtime",
|
||||||
srcs = [
|
srcs = [
|
||||||
":protos_all_proto_text_srcs",
|
":attr_value_proto_text_srcs",
|
||||||
":error_codes_proto_text_srcs",
|
|
||||||
"//tensorflow/core/platform/default/build_config:android_srcs",
|
"//tensorflow/core/platform/default/build_config:android_srcs",
|
||||||
"//tensorflow/core/util/ctc:android_srcs",
|
"//tensorflow/core/util/ctc:android_srcs",
|
||||||
"//tensorflow/core/platform:legacy_srcs_no_runtime",
|
"//tensorflow/core/platform:legacy_srcs_no_runtime",
|
||||||
@ -2713,17 +2728,6 @@ tf_proto_library(
|
|||||||
provide_cc_alias = True,
|
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(
|
tf_proto_library(
|
||||||
name = "protos_all_proto",
|
name = "protos_all_proto",
|
||||||
srcs = COMMON_PROTO_SRCS + ADDITIONAL_CORE_PROTO_SRCS,
|
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()
|
tf_version_info_genrule()
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
@ -2920,11 +2898,10 @@ tf_cuda_library(
|
|||||||
deps = [
|
deps = [
|
||||||
":allocator_registry_impl",
|
":allocator_registry_impl",
|
||||||
":allocator",
|
":allocator",
|
||||||
|
":attr_value_proto_text",
|
||||||
":feature_util",
|
":feature_util",
|
||||||
":lib",
|
":lib",
|
||||||
":lib_internal",
|
":lib_internal",
|
||||||
":protos_all_proto_text",
|
|
||||||
":error_codes_proto_text",
|
|
||||||
":protos_all_cc",
|
":protos_all_cc",
|
||||||
":stats_calculator_portable",
|
":stats_calculator_portable",
|
||||||
":version_lib",
|
":version_lib",
|
||||||
@ -3066,7 +3043,6 @@ tf_cuda_library(
|
|||||||
":framework_internal",
|
":framework_internal",
|
||||||
":lib",
|
":lib",
|
||||||
":lib_internal",
|
":lib_internal",
|
||||||
":proto_text",
|
|
||||||
":protos_all_cc",
|
":protos_all_cc",
|
||||||
"//third_party/eigen3",
|
"//third_party/eigen3",
|
||||||
"@com_google_absl//absl/container:flat_hash_map",
|
"@com_google_absl//absl/container:flat_hash_map",
|
||||||
@ -3125,7 +3101,6 @@ tf_cuda_library(
|
|||||||
":framework_internal",
|
":framework_internal",
|
||||||
":lib",
|
":lib",
|
||||||
":lib_internal",
|
":lib_internal",
|
||||||
":proto_text",
|
|
||||||
":protos_all_cc",
|
":protos_all_cc",
|
||||||
"@com_google_absl//absl/container:flat_hash_set",
|
"@com_google_absl//absl/container:flat_hash_set",
|
||||||
"//third_party/eigen3",
|
"//third_party/eigen3",
|
||||||
@ -3273,7 +3248,6 @@ tf_cuda_library(
|
|||||||
":framework_internal",
|
":framework_internal",
|
||||||
":lib",
|
":lib",
|
||||||
":lib_internal",
|
":lib_internal",
|
||||||
":proto_text",
|
|
||||||
":protos_all_cc",
|
":protos_all_cc",
|
||||||
"@com_google_absl//absl/algorithm:container",
|
"@com_google_absl//absl/algorithm:container",
|
||||||
"@com_google_absl//absl/memory",
|
"@com_google_absl//absl/memory",
|
||||||
@ -3292,7 +3266,6 @@ tf_cuda_library(
|
|||||||
hdrs = CORE_CPU_LIB_HEADERS,
|
hdrs = CORE_CPU_LIB_HEADERS,
|
||||||
deps = [
|
deps = [
|
||||||
":core_cpu_base",
|
":core_cpu_base",
|
||||||
":proto_text",
|
|
||||||
"//tensorflow/core/grappler:grappler_item",
|
"//tensorflow/core/grappler:grappler_item",
|
||||||
] + if_static([":core_cpu_impl"]) + tf_protos_all() + tf_protos_grappler(),
|
] + if_static([":core_cpu_impl"]) + tf_protos_all() + tf_protos_grappler(),
|
||||||
)
|
)
|
||||||
@ -3302,7 +3275,6 @@ tf_cuda_library(
|
|||||||
hdrs = CORE_CPU_LIB_HEADERS,
|
hdrs = CORE_CPU_LIB_HEADERS,
|
||||||
deps = [
|
deps = [
|
||||||
":core_cpu_base_no_ops",
|
":core_cpu_base_no_ops",
|
||||||
":proto_text",
|
|
||||||
"//tensorflow/core/grappler:grappler_item",
|
"//tensorflow/core/grappler:grappler_item",
|
||||||
] + tf_protos_all() + tf_protos_grappler(),
|
] + tf_protos_all() + tf_protos_grappler(),
|
||||||
)
|
)
|
||||||
@ -3320,7 +3292,6 @@ tf_cuda_library(
|
|||||||
":framework",
|
":framework",
|
||||||
":graph",
|
":graph",
|
||||||
":lib",
|
":lib",
|
||||||
":proto_text",
|
|
||||||
":protos_all_cc",
|
":protos_all_cc",
|
||||||
"@com_google_absl//absl/memory",
|
"@com_google_absl//absl/memory",
|
||||||
"@com_google_absl//absl/strings",
|
"@com_google_absl//absl/strings",
|
||||||
@ -3400,7 +3371,6 @@ tf_cuda_library(
|
|||||||
":lib",
|
":lib",
|
||||||
":lib_experimental",
|
":lib_experimental",
|
||||||
":lib_internal",
|
":lib_internal",
|
||||||
":proto_text",
|
|
||||||
":protos_all_cc",
|
":protos_all_cc",
|
||||||
"//tensorflow/core/debug:debug_graph_utils",
|
"//tensorflow/core/debug:debug_graph_utils",
|
||||||
"//tensorflow/core/kernels:function_ops",
|
"//tensorflow/core/kernels:function_ops",
|
||||||
@ -3425,7 +3395,6 @@ cc_library(
|
|||||||
":framework",
|
":framework",
|
||||||
":lib",
|
":lib",
|
||||||
":lib_internal",
|
":lib_internal",
|
||||||
":proto_text",
|
|
||||||
":protos_all_cc",
|
":protos_all_cc",
|
||||||
],
|
],
|
||||||
alwayslink = 1,
|
alwayslink = 1,
|
||||||
@ -3653,7 +3622,6 @@ cc_library(
|
|||||||
":framework_internal",
|
":framework_internal",
|
||||||
":lib",
|
":lib",
|
||||||
":lib_internal",
|
":lib_internal",
|
||||||
":proto_text",
|
|
||||||
"//third_party/eigen3",
|
"//third_party/eigen3",
|
||||||
"@local_config_sycl//sycl",
|
"@local_config_sycl//sycl",
|
||||||
],
|
],
|
||||||
|
@ -34,7 +34,6 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "tensorflow/core/framework/allocator.h"
|
#include "tensorflow/core/framework/allocator.h"
|
||||||
#include "tensorflow/core/framework/control_flow.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_attributes.pb.h"
|
||||||
#include "tensorflow/core/framework/device_base.h"
|
#include "tensorflow/core/framework/device_base.h"
|
||||||
#include "tensorflow/core/framework/graph.pb.h"
|
#include "tensorflow/core/framework/graph.pb.h"
|
||||||
@ -167,7 +166,7 @@ class Device : public DeviceBase {
|
|||||||
virtual ResourceMgr* resource_manager() { return rmgr_; }
|
virtual ResourceMgr* resource_manager() { return rmgr_; }
|
||||||
|
|
||||||
// Summarizes the status of this Device, for debugging.
|
// 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.
|
// Assembles the parameter components into a complete DeviceAttributes value.
|
||||||
static DeviceAttributes BuildDeviceAttributes(
|
static DeviceAttributes BuildDeviceAttributes(
|
||||||
|
@ -38,7 +38,6 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/common_runtime/scoped_allocator_mgr.h"
|
#include "tensorflow/core/common_runtime/scoped_allocator_mgr.h"
|
||||||
#include "tensorflow/core/common_runtime/step_stats_collector.h"
|
#include "tensorflow/core/common_runtime/step_stats_collector.h"
|
||||||
#include "tensorflow/core/framework/function.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.pb.h"
|
||||||
#include "tensorflow/core/framework/graph_def_util.h"
|
#include "tensorflow/core/framework/graph_def_util.h"
|
||||||
#include "tensorflow/core/framework/log_memory.h"
|
#include "tensorflow/core/framework/log_memory.h"
|
||||||
|
@ -31,7 +31,7 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/framework/attr_value.pb.h"
|
#include "tensorflow/core/framework/attr_value.pb.h"
|
||||||
#include "tensorflow/core/framework/function.h"
|
#include "tensorflow/core/framework/function.h"
|
||||||
#include "tensorflow/core/framework/function.pb.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/graph_def_util.h"
|
||||||
#include "tensorflow/core/framework/node_def.pb.h"
|
#include "tensorflow/core/framework/node_def.pb.h"
|
||||||
#include "tensorflow/core/framework/op.h"
|
#include "tensorflow/core/framework/op.h"
|
||||||
|
@ -22,7 +22,7 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/platform/logging.h"
|
#include "tensorflow/core/platform/logging.h"
|
||||||
#include "tensorflow/core/platform/mutex.h"
|
#include "tensorflow/core/platform/mutex.h"
|
||||||
#include "tensorflow/core/platform/types.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"
|
#include "tensorflow/core/public/session_options.h"
|
||||||
|
|
||||||
namespace tensorflow {
|
namespace tensorflow {
|
||||||
@ -61,7 +61,7 @@ const string RegisteredFactoriesErrorMessageLocked() {
|
|||||||
}
|
}
|
||||||
string SessionOptionsToString(const SessionOptions& options) {
|
string SessionOptionsToString(const SessionOptions& options) {
|
||||||
return strings::StrCat("target: \"", options.target,
|
return strings::StrCat("target: \"", options.target,
|
||||||
"\" config: ", ProtoShortDebugString(options.config));
|
"\" config: ", options.config.ShortDebugString());
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
@ -16,9 +16,9 @@ limitations under the License.
|
|||||||
#if TENSORFLOW_USE_SYCL
|
#if TENSORFLOW_USE_SYCL
|
||||||
|
|
||||||
#include "tensorflow/core/common_runtime/sycl/sycl_device.h"
|
#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"
|
#include "tensorflow/core/platform/tracing.h"
|
||||||
|
|
||||||
namespace tensorflow {
|
namespace tensorflow {
|
||||||
|
@ -22,7 +22,7 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/framework/allocator_registry.h"
|
#include "tensorflow/core/framework/allocator_registry.h"
|
||||||
#include "tensorflow/core/framework/device_base.h"
|
#include "tensorflow/core/framework/device_base.h"
|
||||||
#include "tensorflow/core/framework/op_kernel.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/tensor_util.h"
|
||||||
#include "tensorflow/core/framework/types.h"
|
#include "tensorflow/core/framework/types.h"
|
||||||
#include "tensorflow/core/graph/types.h"
|
#include "tensorflow/core/graph/types.h"
|
||||||
@ -100,7 +100,7 @@ Status ThreadPoolDevice::MakeTensorFromProto(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return errors::InvalidArgument("Cannot parse tensor from proto: ",
|
return errors::InvalidArgument("Cannot parse tensor from proto: ",
|
||||||
ProtoDebugString(tensor_proto));
|
tensor_proto.DebugString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThreadPoolDevice::CopyTensorInSameDevice(
|
void ThreadPoolDevice::CopyTensorInSameDevice(
|
||||||
|
@ -101,7 +101,6 @@ tf_cuda_library(
|
|||||||
"//tensorflow/core:graph",
|
"//tensorflow/core:graph",
|
||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
"//tensorflow/core:lib_internal",
|
"//tensorflow/core:lib_internal",
|
||||||
"//tensorflow/core:proto_text",
|
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
],
|
],
|
||||||
alwayslink = 1,
|
alwayslink = 1,
|
||||||
@ -124,7 +123,6 @@ tf_cuda_library(
|
|||||||
"//tensorflow/core:graph",
|
"//tensorflow/core:graph",
|
||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
"//tensorflow/core:lib_internal",
|
"//tensorflow/core:lib_internal",
|
||||||
"//tensorflow/core:proto_text",
|
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
"@com_google_absl//absl/strings",
|
"@com_google_absl//absl/strings",
|
||||||
],
|
],
|
||||||
|
@ -61,7 +61,6 @@ cc_library(
|
|||||||
deps = [
|
deps = [
|
||||||
"//tensorflow/core:framework",
|
"//tensorflow/core:framework",
|
||||||
"//tensorflow/core:master_proto_cc",
|
"//tensorflow/core:master_proto_cc",
|
||||||
"//tensorflow/core:proto_text",
|
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
"//tensorflow/core:worker_proto_cc",
|
"//tensorflow/core:worker_proto_cc",
|
||||||
],
|
],
|
||||||
|
@ -22,6 +22,7 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/framework/function.h"
|
#include "tensorflow/core/framework/function.h"
|
||||||
#include "tensorflow/core/framework/node_def.pb.h"
|
#include "tensorflow/core/framework/node_def.pb.h"
|
||||||
#include "tensorflow/core/framework/node_def_builder.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/graph/node_builder.h"
|
||||||
#include "tensorflow/core/lib/gtl/cleanup.h"
|
#include "tensorflow/core/lib/gtl/cleanup.h"
|
||||||
#include "tensorflow/core/lib/random/random.h"
|
#include "tensorflow/core/lib/random/random.h"
|
||||||
|
@ -34,6 +34,7 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/framework/node_def.pb.h"
|
#include "tensorflow/core/framework/node_def.pb.h"
|
||||||
#include "tensorflow/core/framework/node_def_util.h"
|
#include "tensorflow/core/framework/node_def_util.h"
|
||||||
#include "tensorflow/core/framework/tensor.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/framework/tensor_description.pb.h"
|
||||||
#include "tensorflow/core/graph/graph_partition.h"
|
#include "tensorflow/core/graph/graph_partition.h"
|
||||||
#include "tensorflow/core/graph/tensor_id.h"
|
#include "tensorflow/core/graph/tensor_id.h"
|
||||||
|
@ -14,8 +14,10 @@ limitations under the License.
|
|||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "tensorflow/core/distributed_runtime/message_wrappers.h"
|
#include "tensorflow/core/distributed_runtime/message_wrappers.h"
|
||||||
|
|
||||||
#include "tensorflow/core/framework/cost_graph.pb.h"
|
#include "tensorflow/core/framework/cost_graph.pb.h"
|
||||||
#include "tensorflow/core/framework/step_stats.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/config.pb.h"
|
||||||
#include "tensorflow/core/protobuf/named_tensor.pb.h"
|
#include "tensorflow/core/protobuf/named_tensor.pb.h"
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/framework/graph.pb.h"
|
#include "tensorflow/core/framework/graph.pb.h"
|
||||||
#include "tensorflow/core/framework/step_stats.pb.h"
|
#include "tensorflow/core/framework/step_stats.pb.h"
|
||||||
#include "tensorflow/core/framework/tensor.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/framework/versions.pb.h"
|
||||||
#include "tensorflow/core/protobuf/config.pb.h"
|
#include "tensorflow/core/protobuf/config.pb.h"
|
||||||
#include "tensorflow/core/protobuf/master.pb.h"
|
#include "tensorflow/core/protobuf/master.pb.h"
|
||||||
|
@ -26,6 +26,7 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/distributed_runtime/rpc/grpc_remote_master.h"
|
#include "tensorflow/core/distributed_runtime/rpc/grpc_remote_master.h"
|
||||||
#include "tensorflow/core/framework/attr_value.pb.h"
|
#include "tensorflow/core/framework/attr_value.pb.h"
|
||||||
#include "tensorflow/core/framework/node_def.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/core/errors.h"
|
||||||
#include "tensorflow/core/lib/strings/str_util.h"
|
#include "tensorflow/core/lib/strings/str_util.h"
|
||||||
#include "tensorflow/core/platform/mutex.h"
|
#include "tensorflow/core/platform/mutex.h"
|
||||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#include <vector>
|
#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/attr_value.pb.h"
|
||||||
#include "tensorflow/core/framework/node_def.pb.h"
|
#include "tensorflow/core/framework/node_def.pb.h"
|
||||||
#include "tensorflow/core/framework/numeric_op.h"
|
#include "tensorflow/core/framework/numeric_op.h"
|
||||||
|
@ -209,7 +209,7 @@ string SummarizeTensor(const TensorProto& tensor_proto) {
|
|||||||
Tensor t;
|
Tensor t;
|
||||||
if (!t.FromProto(tensor_proto)) {
|
if (!t.FromProto(tensor_proto)) {
|
||||||
return strings::StrCat(
|
return strings::StrCat(
|
||||||
"<Invalid TensorProto: ", ProtoShortDebugString(tensor_proto), ">");
|
"<Invalid TensorProto: ", tensor_proto.ShortDebugString(), ">");
|
||||||
}
|
}
|
||||||
return t.DebugString();
|
return t.DebugString();
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ limitations under the License.
|
|||||||
#include "absl/strings/str_join.h"
|
#include "absl/strings/str_join.h"
|
||||||
#include "tensorflow/core/framework/allocator.h"
|
#include "tensorflow/core/framework/allocator.h"
|
||||||
#include "tensorflow/core/framework/common_shape_fns.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/graph.pb.h"
|
||||||
#include "tensorflow/core/framework/node_def.pb.h"
|
#include "tensorflow/core/framework/node_def.pb.h"
|
||||||
#include "tensorflow/core/framework/node_def_util.h"
|
#include "tensorflow/core/framework/node_def_util.h"
|
||||||
|
@ -26,7 +26,7 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/framework/node_def.pb.h"
|
#include "tensorflow/core/framework/node_def.pb.h"
|
||||||
#include "tensorflow/core/framework/node_def_util.h"
|
#include "tensorflow/core/framework/node_def_util.h"
|
||||||
#include "tensorflow/core/framework/op_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/errors.h"
|
||||||
#include "tensorflow/core/lib/core/status.h"
|
#include "tensorflow/core/lib/core/status.h"
|
||||||
#include "tensorflow/core/lib/strings/str_util.h"
|
#include "tensorflow/core/lib/strings/str_util.h"
|
||||||
@ -37,7 +37,7 @@ namespace tensorflow {
|
|||||||
string SummarizeGraphDef(const GraphDef& graph_def) {
|
string SummarizeGraphDef(const GraphDef& graph_def) {
|
||||||
string ret;
|
string ret;
|
||||||
strings::StrAppend(
|
strings::StrAppend(
|
||||||
&ret, "versions = ", ProtoShortDebugString(graph_def.versions()), ";\n");
|
&ret, "versions = ", graph_def.versions().ShortDebugString(), ";\n");
|
||||||
for (const NodeDef& node : graph_def.node()) {
|
for (const NodeDef& node : graph_def.node()) {
|
||||||
strings::StrAppend(&ret, SummarizeNodeDef(node), ";\n");
|
strings::StrAppend(&ret, SummarizeNodeDef(node), ";\n");
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,6 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "tensorflow/core/framework/kernel_def_builder.h"
|
#include "tensorflow/core/framework/kernel_def_builder.h"
|
||||||
#include "tensorflow/core/framework/attr_value.pb.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"
|
#include "tensorflow/core/framework/kernel_def.pb.h"
|
||||||
|
|
||||||
namespace tensorflow {
|
namespace tensorflow {
|
||||||
@ -132,7 +131,7 @@ KernelDefBuilder& KernelDefBuilder::HostMemory(const char* arg_name) {
|
|||||||
KernelDefBuilder& KernelDefBuilder::Label(const char* label) {
|
KernelDefBuilder& KernelDefBuilder::Label(const char* label) {
|
||||||
CHECK_EQ(kernel_def_->label(), "")
|
CHECK_EQ(kernel_def_->label(), "")
|
||||||
<< "Trying to set a kernel's label a second time: '" << 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);
|
kernel_def_->set_label(label);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "tensorflow/core/framework/attr_value.pb.h"
|
#include "tensorflow/core/framework/attr_value.pb.h"
|
||||||
#include "tensorflow/core/framework/attr_value_util.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/node_def_util.h"
|
||||||
#include "tensorflow/core/framework/types.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()) {
|
for (const auto& constraint : kernel_def.constraint()) {
|
||||||
if (constraint.allowed_values().list().type_size() == 0) {
|
if (constraint.allowed_values().list().type_size() == 0) {
|
||||||
return errors::Unimplemented(
|
return errors::Unimplemented(
|
||||||
"KernelDef '", ProtoShortDebugString(kernel_def),
|
"KernelDef '", kernel_def.ShortDebugString(),
|
||||||
" has constraint on attr '", constraint.name(),
|
" has constraint on attr '", constraint.name(),
|
||||||
"' with unsupported type: ",
|
"' with unsupported type: ",
|
||||||
SummarizeAttrValue(constraint.allowed_values()));
|
SummarizeAttrValue(constraint.allowed_values()));
|
||||||
@ -54,7 +54,7 @@ Status KernelAttrsMatch(const KernelDef& kernel_def, AttrSlice attrs,
|
|||||||
} else {
|
} else {
|
||||||
if (!AttrValueHasType(*found, "list(type)").ok()) {
|
if (!AttrValueHasType(*found, "list(type)").ok()) {
|
||||||
return errors::InvalidArgument(
|
return errors::InvalidArgument(
|
||||||
"KernelDef '", ProtoShortDebugString(kernel_def),
|
"KernelDef '", kernel_def.ShortDebugString(),
|
||||||
"' has constraint on attr '", constraint.name(),
|
"' has constraint on attr '", constraint.name(),
|
||||||
"' that has value '", SummarizeAttrValue(*found),
|
"' that has value '", SummarizeAttrValue(*found),
|
||||||
"' that does not have type 'type' or 'list(type)' in NodeDef "
|
"' 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(
|
return errors::InvalidArgument(
|
||||||
"OpKernel '", kernel_def.op(), "' has constraint on attr '",
|
"OpKernel '", kernel_def.op(), "' has constraint on attr '",
|
||||||
constraint.name(), "' not in NodeDef '", attrs.SummarizeNode(),
|
constraint.name(), "' not in NodeDef '", attrs.SummarizeNode(),
|
||||||
"', KernelDef: '", ProtoShortDebugString(kernel_def), "'");
|
"', KernelDef: '", kernel_def.ShortDebugString(), "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*match = true;
|
*match = true;
|
||||||
|
@ -15,7 +15,6 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "tensorflow/core/framework/log_memory.h"
|
#include "tensorflow/core/framework/log_memory.h"
|
||||||
|
|
||||||
#include "tensorflow/core/framework/log_memory.pb_text.h"
|
|
||||||
#include "tensorflow/core/framework/log_memory.pb.h"
|
#include "tensorflow/core/framework/log_memory.pb.h"
|
||||||
|
|
||||||
namespace tensorflow {
|
namespace tensorflow {
|
||||||
@ -33,7 +32,7 @@ void OutputToLog(const T& proto) {
|
|||||||
const size_t index = type_name.find_last_of(".");
|
const size_t index = type_name.find_last_of(".");
|
||||||
if (index != string::npos) type_name = type_name.substr(index + 1);
|
if (index != string::npos) type_name = type_name.substr(index + 1);
|
||||||
LOG(INFO) << LogMemory::kLogMemoryLabel << " " << type_name << " { "
|
LOG(INFO) << LogMemory::kLogMemoryLabel << " " << type_name << " { "
|
||||||
<< ProtoShortDebugString(proto) << " }";
|
<< proto.ShortDebugString() << " }";
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -23,11 +23,11 @@ limitations under the License.
|
|||||||
#include "absl/strings/str_join.h"
|
#include "absl/strings/str_join.h"
|
||||||
#include "tensorflow/core/framework/attr_value.pb.h"
|
#include "tensorflow/core/framework/attr_value.pb.h"
|
||||||
#include "tensorflow/core/framework/attr_value_util.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.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_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/framework/tensor_shape.pb.h"
|
||||||
#include "tensorflow/core/graph/graph.h"
|
#include "tensorflow/core/graph/graph.h"
|
||||||
#include "tensorflow/core/lib/core/errors.h"
|
#include "tensorflow/core/lib/core/errors.h"
|
||||||
@ -339,7 +339,7 @@ DEFINE_GET_ATTR(PartialTensorShape, shape, "shape", emplace_back,
|
|||||||
DEFINE_GET_ATTR(
|
DEFINE_GET_ATTR(
|
||||||
Tensor, tensor, "tensor", emplace_back, t, Tensor t; if (!t.FromProto(v)) {
|
Tensor, tensor, "tensor", emplace_back, t, Tensor t; if (!t.FromProto(v)) {
|
||||||
return errors::InvalidArgument("Attr ", attr_name, " has value ",
|
return errors::InvalidArgument("Attr ", attr_name, " has value ",
|
||||||
ProtoShortDebugString(v),
|
v.ShortDebugString(),
|
||||||
" that can't be converted to a Tensor");
|
" that can't be converted to a Tensor");
|
||||||
})
|
})
|
||||||
DEFINE_GET_ATTR(NameAttrList, func, "func", emplace_back, v, ;);
|
DEFINE_GET_ATTR(NameAttrList, func, "func", emplace_back, v, ;);
|
||||||
@ -483,7 +483,7 @@ Status AddArgToSig(const NodeDefOrAttrSlice& node_or_attrs,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return errors::InvalidArgument("Missing type or type_attr field in ",
|
return errors::InvalidArgument("Missing type or type_attr field in ",
|
||||||
ProtoShortDebugString(arg_def));
|
arg_def.ShortDebugString());
|
||||||
}
|
}
|
||||||
} else if (!arg_def.type_attr().empty()) {
|
} else if (!arg_def.type_attr().empty()) {
|
||||||
const AttrValue* attr_value;
|
const AttrValue* attr_value;
|
||||||
@ -501,7 +501,7 @@ Status AddArgToSig(const NodeDefOrAttrSlice& node_or_attrs,
|
|||||||
sig->push_back(arg_def.type());
|
sig->push_back(arg_def.type());
|
||||||
} else {
|
} else {
|
||||||
return errors::InvalidArgument("No type fields in ",
|
return errors::InvalidArgument("No type fields in ",
|
||||||
ProtoShortDebugString(arg_def));
|
arg_def.ShortDebugString());
|
||||||
}
|
}
|
||||||
if (arg_def.is_ref()) {
|
if (arg_def.is_ref()) {
|
||||||
// For all types that were added by this function call, make them refs.
|
// For all types that were added by this function call, make them refs.
|
||||||
|
@ -18,9 +18,10 @@ limitations under the License.
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
#include "tensorflow/core/framework/attr_value.pb.h"
|
#include "tensorflow/core/framework/attr_value.pb.h"
|
||||||
#include "tensorflow/core/framework/attr_value_util.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/framework/types.h"
|
||||||
#include "tensorflow/core/lib/core/errors.h"
|
#include "tensorflow/core/lib/core/errors.h"
|
||||||
#include "tensorflow/core/lib/core/stringpiece.h"
|
#include "tensorflow/core/lib/core/stringpiece.h"
|
||||||
@ -187,7 +188,7 @@ const ApiDef::Arg* FindInputArg(StringPiece name, const ApiDef& api_def) {
|
|||||||
do { \
|
do { \
|
||||||
if (!(EXPR)) { \
|
if (!(EXPR)) { \
|
||||||
return errors::InvalidArgument( \
|
return errors::InvalidArgument( \
|
||||||
__VA_ARGS__, "; in OpDef: ", ProtoShortDebugString(op_def)); \
|
__VA_ARGS__, "; in OpDef: ", op_def.ShortDebugString()); \
|
||||||
} \
|
} \
|
||||||
} while (false)
|
} while (false)
|
||||||
|
|
||||||
|
@ -26,8 +26,8 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/framework/allocation_description.pb.h"
|
#include "tensorflow/core/framework/allocation_description.pb.h"
|
||||||
#include "tensorflow/core/framework/attr_value_util.h"
|
#include "tensorflow/core/framework/attr_value_util.h"
|
||||||
#include "tensorflow/core/framework/device_attributes.pb.h"
|
#include "tensorflow/core/framework/device_attributes.pb.h"
|
||||||
#include "tensorflow/core/framework/graph.pb_text.h"
|
#include "tensorflow/core/framework/graph.pb.h"
|
||||||
#include "tensorflow/core/framework/kernel_def.pb_text.h"
|
#include "tensorflow/core/framework/kernel_def.pb.h"
|
||||||
#include "tensorflow/core/framework/kernel_def_util.h"
|
#include "tensorflow/core/framework/kernel_def_util.h"
|
||||||
#include "tensorflow/core/framework/log_memory.h"
|
#include "tensorflow/core/framework/log_memory.h"
|
||||||
#include "tensorflow/core/framework/memory_types.h"
|
#include "tensorflow/core/framework/memory_types.h"
|
||||||
@ -1248,8 +1248,8 @@ Status FindKernelRegistration(
|
|||||||
"Multiple OpKernel registrations match NodeDef '",
|
"Multiple OpKernel registrations match NodeDef '",
|
||||||
FormatNodeDefForError(node_name, has_experimental_debug_info,
|
FormatNodeDefForError(node_name, has_experimental_debug_info,
|
||||||
experimental_debug_info),
|
experimental_debug_info),
|
||||||
"': '", ProtoShortDebugString((*reg)->def), "' and '",
|
"': '", (*reg)->def.ShortDebugString(), "' and '",
|
||||||
ProtoShortDebugString(iter->second.def), "'");
|
iter->second.def.ShortDebugString(), "'");
|
||||||
}
|
}
|
||||||
*reg = &iter->second;
|
*reg = &iter->second;
|
||||||
} else {
|
} else {
|
||||||
@ -1274,8 +1274,8 @@ Status FindKernelRegistration(
|
|||||||
"Multiple Default OpKernel registrations match NodeDef '",
|
"Multiple Default OpKernel registrations match NodeDef '",
|
||||||
FormatNodeDefForError(node_name, has_experimental_debug_info,
|
FormatNodeDefForError(node_name, has_experimental_debug_info,
|
||||||
experimental_debug_info),
|
experimental_debug_info),
|
||||||
"': '", ProtoShortDebugString((*reg)->def), "' and '",
|
"': '", (*reg)->def.ShortDebugString(), "' and '",
|
||||||
ProtoShortDebugString(iter->second.def), "'");
|
iter->second.def.ShortDebugString(), "'");
|
||||||
}
|
}
|
||||||
*reg = &iter->second;
|
*reg = &iter->second;
|
||||||
} else {
|
} else {
|
||||||
@ -1424,7 +1424,7 @@ Status SupportedDeviceTypesForNode(
|
|||||||
void LogAllRegisteredKernels() {
|
void LogAllRegisteredKernels() {
|
||||||
KernelList kernel_list = GetAllRegisteredKernels();
|
KernelList kernel_list = GetAllRegisteredKernels();
|
||||||
for (const auto& kernel_def : kernel_list.kernel()) {
|
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);
|
const Status status = op_registry.LookUp(kernel_def.op(), &op_reg_data);
|
||||||
if (!status.ok()) {
|
if (!status.ok()) {
|
||||||
// TODO(josh11b): Make this a hard error.
|
// 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();
|
<< "') for unknown op: " << kernel_def.op();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/framework/shape_inference.h"
|
#include "tensorflow/core/framework/shape_inference.h"
|
||||||
|
|
||||||
#include "tensorflow/core/framework/bounds_check.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/partial_tensor_shape.h"
|
||||||
#include "tensorflow/core/framework/tensor_shape.pb.h"
|
#include "tensorflow/core/framework/tensor_shape.pb.h"
|
||||||
#include "tensorflow/core/lib/core/errors.h"
|
#include "tensorflow/core/lib/core/errors.h"
|
||||||
@ -346,7 +346,7 @@ string InferenceContext::DebugString(DimensionHandle d) {
|
|||||||
|
|
||||||
string InferenceContext::DebugString() const {
|
string InferenceContext::DebugString() const {
|
||||||
return strings::StrCat("InferenceContext for node: ",
|
return strings::StrCat("InferenceContext for node: ",
|
||||||
ProtoDebugString(*node_def_));
|
node_def_->DebugString());
|
||||||
}
|
}
|
||||||
|
|
||||||
string InferenceContext::DebugString(const ShapeAndType& shape_and_type) {
|
string InferenceContext::DebugString(const ShapeAndType& shape_and_type) {
|
||||||
|
@ -18,7 +18,7 @@ limitations under the License.
|
|||||||
#ifdef INTEL_MKL
|
#ifdef INTEL_MKL
|
||||||
|
|
||||||
#include "tensorflow/core/framework/op_kernel.h"
|
#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"
|
#include "tensorflow/core/graph/graph.h"
|
||||||
|
|
||||||
namespace tensorflow {
|
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.
|
// Now we just construct a search string to match what we are looking for.
|
||||||
string search_string = kMklNameChangeOpLabelPattern;
|
string search_string = kMklNameChangeOpLabelPattern;
|
||||||
search_string += string(";") + string(" T in [");
|
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;
|
return kernel.find(search_string) != string::npos;
|
||||||
}
|
}
|
||||||
|
@ -919,7 +919,6 @@ ARRAY_DEPS = [
|
|||||||
"//tensorflow/core:framework",
|
"//tensorflow/core:framework",
|
||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
"//tensorflow/core:lib_internal",
|
"//tensorflow/core:lib_internal",
|
||||||
"//tensorflow/core:proto_text",
|
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
"//third_party/eigen3",
|
"//third_party/eigen3",
|
||||||
] + if_sycl(["//tensorflow/core:sycl_runtime"])
|
] + if_sycl(["//tensorflow/core:sycl_runtime"])
|
||||||
@ -2429,7 +2428,6 @@ tf_cuda_cc_test(
|
|||||||
"//tensorflow/core:core_cpu_internal",
|
"//tensorflow/core:core_cpu_internal",
|
||||||
"//tensorflow/core:framework",
|
"//tensorflow/core:framework",
|
||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
"//tensorflow/core:proto_text",
|
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
"//tensorflow/core:test",
|
"//tensorflow/core:test",
|
||||||
"//tensorflow/core:test_main",
|
"//tensorflow/core:test_main",
|
||||||
@ -4726,7 +4724,6 @@ cc_library(
|
|||||||
PARSING_DEPS = [
|
PARSING_DEPS = [
|
||||||
"//tensorflow/core:framework",
|
"//tensorflow/core:framework",
|
||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
"//tensorflow/core:proto_text",
|
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ limitations under the License.
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "tensorflow/core/example/example.pb.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/common_shape_fns.h"
|
#include "tensorflow/core/framework/common_shape_fns.h"
|
||||||
#include "tensorflow/core/framework/numeric_op.h"
|
#include "tensorflow/core/framework/numeric_op.h"
|
||||||
#include "tensorflow/core/framework/register_types.h"
|
#include "tensorflow/core/framework/register_types.h"
|
||||||
@ -646,7 +646,7 @@ class ParseSingleSequenceExampleOp : public OpKernel {
|
|||||||
errors::InvalidArgument("Name: ", name, ", Context feature: ", key,
|
errors::InvalidArgument("Name: ", name, ", Context feature: ", key,
|
||||||
". Data types don't match. ",
|
". Data types don't match. ",
|
||||||
"Expected type: ", DataTypeString(dtype),
|
"Expected type: ", DataTypeString(dtype),
|
||||||
" Feature is: ", ProtoDebugString(f)));
|
" Feature is: ", f.DebugString()));
|
||||||
|
|
||||||
OP_REQUIRES_OK(ctx, FeatureDenseCopy(0, name, key, dtype, shape, f,
|
OP_REQUIRES_OK(ctx, FeatureDenseCopy(0, name, key, dtype, shape, f,
|
||||||
context_dense_values[d]));
|
context_dense_values[d]));
|
||||||
@ -675,7 +675,7 @@ class ParseSingleSequenceExampleOp : public OpKernel {
|
|||||||
errors::InvalidArgument("Name: ", name, ", Context feature: ", key,
|
errors::InvalidArgument("Name: ", name, ", Context feature: ", key,
|
||||||
". Data types don't match. ",
|
". Data types don't match. ",
|
||||||
"Expected type: ", DataTypeString(dtype),
|
"Expected type: ", DataTypeString(dtype),
|
||||||
" Feature is: ", ProtoDebugString(f)));
|
" Feature is: ", f.DebugString()));
|
||||||
|
|
||||||
Tensor feature_values = FeatureSparseCopy(0, key, dtype, f);
|
Tensor feature_values = FeatureSparseCopy(0, key, dtype, f);
|
||||||
const int64 num_elements = feature_values.NumElements();
|
const int64 num_elements = feature_values.NumElements();
|
||||||
@ -756,7 +756,7 @@ class ParseSingleSequenceExampleOp : public OpKernel {
|
|||||||
"Name: ", name, ", Feature list: ", key, ", Index: ", t,
|
"Name: ", name, ", Feature list: ", key, ", Index: ", t,
|
||||||
". Data types don't match. ",
|
". Data types don't match. ",
|
||||||
"Expected type: ", DataTypeString(dtype),
|
"Expected type: ", DataTypeString(dtype),
|
||||||
" Feature is: ", ProtoDebugString(f)));
|
" Feature is: ", f.DebugString()));
|
||||||
OP_REQUIRES_OK(ctx, FeatureDenseCopy(t, name, key, dtype, shape, f,
|
OP_REQUIRES_OK(ctx, FeatureDenseCopy(t, name, key, dtype, shape, f,
|
||||||
feature_list_dense_values[d]));
|
feature_list_dense_values[d]));
|
||||||
}
|
}
|
||||||
@ -786,7 +786,7 @@ class ParseSingleSequenceExampleOp : public OpKernel {
|
|||||||
", Index: ", t,
|
", Index: ", t,
|
||||||
". Data types don't match. ",
|
". Data types don't match. ",
|
||||||
"Expected type: ", DataTypeString(dtype),
|
"Expected type: ", DataTypeString(dtype),
|
||||||
" Feature is: ", ProtoDebugString(f)));
|
" Feature is: ", f.DebugString()));
|
||||||
sparse_values_tmp.push_back(FeatureSparseCopy(t, key, dtype, f));
|
sparse_values_tmp.push_back(FeatureSparseCopy(t, key, dtype, f));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -19,7 +19,7 @@ limitations under the License.
|
|||||||
#include "absl/base/casts.h"
|
#include "absl/base/casts.h"
|
||||||
#include "absl/container/flat_hash_map.h"
|
#include "absl/container/flat_hash_map.h"
|
||||||
#include "tensorflow/core/example/example.pb.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/allocator.h"
|
||||||
#include "tensorflow/core/framework/numeric_op.h"
|
#include "tensorflow/core/framework/numeric_op.h"
|
||||||
#include "tensorflow/core/framework/op_kernel.h"
|
#include "tensorflow/core/framework/op_kernel.h"
|
||||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "tensorflow/core/example/example.pb.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/numeric_op.h"
|
#include "tensorflow/core/framework/numeric_op.h"
|
||||||
#include "tensorflow/core/framework/register_types.h"
|
#include "tensorflow/core/framework/register_types.h"
|
||||||
#include "tensorflow/core/lib/core/errors.h"
|
#include "tensorflow/core/lib/core/errors.h"
|
||||||
@ -252,7 +252,7 @@ Status SingleExampleProtoToTensors(
|
|||||||
", Feature: ", key,
|
", Feature: ", key,
|
||||||
". Data types don't match. ",
|
". Data types don't match. ",
|
||||||
"Expected type: ", DataTypeString(dtype),
|
"Expected type: ", DataTypeString(dtype),
|
||||||
" Feature is: ", ProtoDebugString(f));
|
" Feature is: ", f.DebugString());
|
||||||
}
|
}
|
||||||
TF_RETURN_IF_ERROR(FeatureDenseCopy(batch_index, example_name, key, dtype,
|
TF_RETURN_IF_ERROR(FeatureDenseCopy(batch_index, example_name, key, dtype,
|
||||||
shape, f,
|
shape, f,
|
||||||
@ -284,7 +284,7 @@ Status SingleExampleProtoToTensors(
|
|||||||
", Feature: ", key,
|
", Feature: ", key,
|
||||||
". Data types don't match. ",
|
". Data types don't match. ",
|
||||||
"Expected type: ", DataTypeString(dtype),
|
"Expected type: ", DataTypeString(dtype),
|
||||||
" Feature is: ", ProtoDebugString(f));
|
" Feature is: ", f.DebugString());
|
||||||
}
|
}
|
||||||
(*output_sparse_values_tmp)[d][batch_index] =
|
(*output_sparse_values_tmp)[d][batch_index] =
|
||||||
FeatureSparseCopy(batch_index, key, dtype, f);
|
FeatureSparseCopy(batch_index, key, dtype, f);
|
||||||
|
@ -50,7 +50,6 @@ cc_library(
|
|||||||
"//tensorflow/core:framework_internal",
|
"//tensorflow/core:framework_internal",
|
||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
"//tensorflow/core:lib_internal",
|
"//tensorflow/core:lib_internal",
|
||||||
"//tensorflow/core:proto_text",
|
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -23,10 +23,9 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "tensorflow/core/framework/register_types.h"
|
#include "tensorflow/core/framework/register_types.h"
|
||||||
#include "tensorflow/core/framework/tensor.pb.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/tensor_shape.pb.h"
|
||||||
#include "tensorflow/core/framework/types.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.h"
|
||||||
#include "tensorflow/core/framework/variant_op_registry.h"
|
#include "tensorflow/core/framework/variant_op_registry.h"
|
||||||
#include "tensorflow/core/framework/variant_tensor_data.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));
|
ParseEntryProto(iter_->key(), iter_->value(), &entry_copy));
|
||||||
if (!TensorShape::IsValid(entry_copy.shape())) {
|
if (!TensorShape::IsValid(entry_copy.shape())) {
|
||||||
return errors::DataLoss("Invalid tensor shape: ", key, " ",
|
return errors::DataLoss("Invalid tensor shape: ", key, " ",
|
||||||
ProtoShortDebugString(entry_copy.shape()));
|
entry_copy.shape().ShortDebugString());
|
||||||
}
|
}
|
||||||
|
|
||||||
*entry = entry_copy;
|
*entry = entry_copy;
|
||||||
@ -920,7 +919,7 @@ Status BundleReader::ReadCurrent(Tensor* val) {
|
|||||||
TF_RETURN_IF_ERROR(ParseEntryProto(iter_->key(), iter_->value(), &entry));
|
TF_RETURN_IF_ERROR(ParseEntryProto(iter_->key(), iter_->value(), &entry));
|
||||||
if (!TensorShape::IsValid(entry.shape())) {
|
if (!TensorShape::IsValid(entry.shape())) {
|
||||||
return errors::DataLoss("Invalid tensor shape: ", iter_->key(), " ",
|
return errors::DataLoss("Invalid tensor shape: ", iter_->key(), " ",
|
||||||
ProtoShortDebugString(entry.shape()));
|
entry.shape().ShortDebugString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry.slices().empty()) {
|
if (entry.slices().empty()) {
|
||||||
@ -1095,9 +1094,8 @@ string BundleReader::DebugString() {
|
|||||||
CHECK(entry.ParseFromArray(value().data(), value().size()));
|
CHECK(entry.ParseFromArray(value().data(), value().size()));
|
||||||
if (entry.slices_size() > 0) continue; // Slice of some partitioned var.
|
if (entry.slices_size() > 0) continue; // Slice of some partitioned var.
|
||||||
|
|
||||||
strings::StrAppend(&shape_str, key(), " (",
|
strings::StrAppend(&shape_str, key(), " (", DataType_Name(entry.dtype()),
|
||||||
EnumName_DataType(entry.dtype()), ") ",
|
") ", TensorShape(entry.shape()).DebugString());
|
||||||
TensorShape(entry.shape()).DebugString());
|
|
||||||
strings::StrAppend(&shape_str, "\n");
|
strings::StrAppend(&shape_str, "\n");
|
||||||
}
|
}
|
||||||
return shape_str;
|
return shape_str;
|
||||||
|
@ -17,7 +17,8 @@ limitations under the License.
|
|||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#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/framework/versions.h"
|
||||||
#include "tensorflow/core/lib/core/errors.h"
|
#include "tensorflow/core/lib/core/errors.h"
|
||||||
#include "tensorflow/core/lib/gtl/stl_util.h"
|
#include "tensorflow/core/lib/gtl/stl_util.h"
|
||||||
@ -301,7 +302,7 @@ const string TensorSliceReader::DebugString() const {
|
|||||||
if (status().ok()) {
|
if (status().ok()) {
|
||||||
for (auto e : Tensors()) {
|
for (auto e : Tensors()) {
|
||||||
strings::StrAppend(&shape_str, e.first, " (",
|
strings::StrAppend(&shape_str, e.first, " (",
|
||||||
EnumName_DataType(e.second->type()), ") ",
|
DataType_Name(e.second->type()), ") ",
|
||||||
e.second->shape().DebugString());
|
e.second->shape().DebugString());
|
||||||
// Indicates if a tensor has more than 1 slice (i.e., it's partitioned).
|
// Indicates if a tensor has more than 1 slice (i.e., it's partitioned).
|
||||||
const int num_slices = e.second->Slices().size();
|
const int num_slices = e.second->Slices().size();
|
||||||
|
@ -32,7 +32,6 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/platform/logging.h"
|
#include "tensorflow/core/platform/logging.h"
|
||||||
#include "tensorflow/core/platform/macros.h"
|
#include "tensorflow/core/platform/macros.h"
|
||||||
#include "tensorflow/core/platform/types.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.pb.h"
|
||||||
#include "tensorflow/core/util/saved_tensor_slice_util.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
|
// The same tensor has been registered -- we verify that the shapes and the
|
||||||
// type agree.
|
// type agree.
|
||||||
const SavedSliceMeta& ssm = sts_.meta().tensor(index);
|
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());
|
TensorShape ssm_shape(ssm.shape());
|
||||||
if (!shape.IsSameSize(ssm_shape)) {
|
if (!shape.IsSameSize(ssm_shape)) {
|
||||||
return errors::Internal(
|
return errors::Internal(
|
||||||
|
@ -45,7 +45,6 @@ tf_cc_test(
|
|||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
"//tensorflow/core:lib_internal",
|
"//tensorflow/core:lib_internal",
|
||||||
"//tensorflow/core:op_gen_lib",
|
"//tensorflow/core:op_gen_lib",
|
||||||
"//tensorflow/core:proto_text",
|
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
"//tensorflow/core:test",
|
"//tensorflow/core:test",
|
||||||
"//tensorflow/core:test_main",
|
"//tensorflow/core:test_main",
|
||||||
|
@ -598,7 +598,6 @@ cc_library(
|
|||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
"//tensorflow/core:lib_internal",
|
"//tensorflow/core:lib_internal",
|
||||||
"//tensorflow/core:op_gen_lib",
|
"//tensorflow/core:op_gen_lib",
|
||||||
"//tensorflow/core:proto_text",
|
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
"@com_google_absl//absl/strings",
|
"@com_google_absl//absl/strings",
|
||||||
],
|
],
|
||||||
|
@ -23,11 +23,10 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/framework/api_def.pb.h"
|
#include "tensorflow/core/framework/api_def.pb.h"
|
||||||
#include "tensorflow/core/framework/attr_value.pb.h"
|
#include "tensorflow/core/framework/attr_value.pb.h"
|
||||||
#include "tensorflow/core/framework/op.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.pb.h"
|
||||||
#include "tensorflow/core/framework/op_def_util.h"
|
#include "tensorflow/core/framework/op_def_util.h"
|
||||||
#include "tensorflow/core/framework/op_gen_lib.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.h"
|
||||||
#include "tensorflow/core/framework/types.pb.h"
|
#include "tensorflow/core/framework/types.pb.h"
|
||||||
#include "tensorflow/core/lib/gtl/map_util.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) {
|
string TensorPBString(const TensorProto& pb) {
|
||||||
// Note: This gets used in the argument list, and so must survive naive
|
// Note: This gets used in the argument list, and so must survive naive
|
||||||
// word wrapping.
|
// word wrapping.
|
||||||
return strings::StrCat("\"\"\"", ProtoShortDebugString(pb), "\"\"\"");
|
return strings::StrCat("\"\"\"", pb.ShortDebugString(), "\"\"\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
class GenEagerPythonOp : public python_op_gen_internal::GenPythonOp {
|
class GenEagerPythonOp : public python_op_gen_internal::GenPythonOp {
|
||||||
@ -1078,7 +1077,7 @@ from tensorflow.tools.docs import doc_controls as _doc_controls
|
|||||||
)");
|
)");
|
||||||
|
|
||||||
result.append("# ");
|
result.append("# ");
|
||||||
auto ops_text = ProtoDebugString(cleaned_ops);
|
auto ops_text = cleaned_ops.DebugString();
|
||||||
absl::StripTrailingAsciiWhitespace(&ops_text);
|
absl::StripTrailingAsciiWhitespace(&ops_text);
|
||||||
result.append(str_util::StringReplace(ops_text, "\n", "\n# ", true));
|
result.append(str_util::StringReplace(ops_text, "\n", "\n# ", true));
|
||||||
result.append("\n");
|
result.append("\n");
|
||||||
|
@ -26,11 +26,9 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/framework/api_def.pb.h"
|
#include "tensorflow/core/framework/api_def.pb.h"
|
||||||
#include "tensorflow/core/framework/attr_value.pb.h"
|
#include "tensorflow/core/framework/attr_value.pb.h"
|
||||||
#include "tensorflow/core/framework/op.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.pb.h"
|
||||||
#include "tensorflow/core/framework/op_def_util.h"
|
#include "tensorflow/core/framework/op_def_util.h"
|
||||||
#include "tensorflow/core/framework/op_gen_lib.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.pb.h"
|
||||||
#include "tensorflow/core/framework/tensor_shape.pb.h"
|
#include "tensorflow/core/framework/tensor_shape.pb.h"
|
||||||
#include "tensorflow/core/framework/types.h"
|
#include "tensorflow/core/framework/types.h"
|
||||||
@ -379,7 +377,7 @@ string ShapeToPython(const TensorShapeProto& shape) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string TensorToPython(const TensorProto& proto) {
|
string TensorToPython(const TensorProto& proto) {
|
||||||
return ProtoShortDebugString(proto);
|
return proto.ShortDebugString();
|
||||||
}
|
}
|
||||||
|
|
||||||
string AttrListToPython(const AttrValue& value,
|
string AttrListToPython(const AttrValue& value,
|
||||||
|
Loading…
Reference in New Issue
Block a user