From cabb1ed2cf2d059f1e5415dd4bd13dcaa10e258c Mon Sep 17 00:00:00 2001 From: Gunhan Gulsoy Date: Wed, 1 Apr 2020 08:51:51 -0700 Subject: [PATCH] Reduce dependence from tensorflow/c to tensorflow/core/lib. Use the migrated headers under tensorflow/core/platform. PiperOrigin-RevId: 304194185 Change-Id: I476004f49e554b07f5670b7f5b0c3c61a5ddc839 --- tensorflow/c/c_api.cc | 12 ++++----- tensorflow/c/c_api_experimental.cc | 2 +- tensorflow/c/c_api_function.cc | 4 +-- tensorflow/c/c_api_function_test.cc | 7 +++-- tensorflow/c/c_api_internal.h | 2 +- tensorflow/c/c_api_test.cc | 4 +-- tensorflow/c/c_test_util.cc | 2 +- tensorflow/c/checkpoint_reader.cc | 4 +-- tensorflow/c/checkpoint_reader.h | 2 +- tensorflow/c/eager/c_api.cc | 27 +++++++------------ tensorflow/c/eager/c_api_experimental.cc | 2 +- tensorflow/c/eager/c_api_experimental_test.cc | 2 +- tensorflow/c/eager/c_api_internal.h | 4 +-- tensorflow/c/eager/c_api_test.cc | 2 +- .../c/eager/c_api_unified_experimental.cc | 2 +- .../eager/c_api_unified_experimental_test.cc | 2 +- tensorflow/c/experimental/network.cc | 4 +-- tensorflow/c/experimental/network_internal.h | 2 +- tensorflow/c/experimental/network_test.cc | 4 +-- tensorflow/c/experimental/rendezvous.cc | 6 ++--- tensorflow/c/tf_tensor.cc | 2 +- tensorflow/c/while_loop_test.cc | 3 +-- tensorflow/core/platform/BUILD | 3 +++ 23 files changed, 49 insertions(+), 55 deletions(-) diff --git a/tensorflow/c/c_api.cc b/tensorflow/c/c_api.cc index bc1fbd3fcf5..bd1ada3e5d2 100644 --- a/tensorflow/c/c_api.cc +++ b/tensorflow/c/c_api.cc @@ -56,16 +56,16 @@ limitations under the License. #include "tensorflow/core/graph/graph_constructor.h" #include "tensorflow/core/graph/node_builder.h" #include "tensorflow/core/graph/validate.h" -#include "tensorflow/core/lib/core/coding.h" -#include "tensorflow/core/lib/core/errors.h" -#include "tensorflow/core/lib/core/status.h" -#include "tensorflow/core/lib/core/stringpiece.h" #include "tensorflow/core/lib/gtl/array_slice.h" -#include "tensorflow/core/lib/strings/str_util.h" -#include "tensorflow/core/lib/strings/strcat.h" +#include "tensorflow/core/platform/coding.h" +#include "tensorflow/core/platform/errors.h" #include "tensorflow/core/platform/mem.h" #include "tensorflow/core/platform/mutex.h" #include "tensorflow/core/platform/protobuf.h" +#include "tensorflow/core/platform/status.h" +#include "tensorflow/core/platform/str_util.h" +#include "tensorflow/core/platform/strcat.h" +#include "tensorflow/core/platform/stringpiece.h" #include "tensorflow/core/platform/thread_annotations.h" #include "tensorflow/core/platform/types.h" #include "tensorflow/core/public/session.h" diff --git a/tensorflow/c/c_api_experimental.cc b/tensorflow/c/c_api_experimental.cc index 1e9498777c4..f7ddabd1bb0 100644 --- a/tensorflow/c/c_api_experimental.cc +++ b/tensorflow/c/c_api_experimental.cc @@ -30,11 +30,11 @@ limitations under the License. #include "tensorflow/core/framework/tensor.pb.h" #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/graph/node_builder.h" -#include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/platform/casts.h" #include "tensorflow/core/platform/init_main.h" #include "tensorflow/core/platform/net.h" #include "tensorflow/core/platform/platform.h" +#include "tensorflow/core/platform/strcat.h" #include "tensorflow/core/protobuf/config.pb.h" #include "tensorflow/core/protobuf/tensorflow_server.pb.h" diff --git a/tensorflow/c/c_api_function.cc b/tensorflow/c/c_api_function.cc index a235ea0cf5a..637801ed7e8 100644 --- a/tensorflow/c/c_api_function.cc +++ b/tensorflow/c/c_api_function.cc @@ -27,8 +27,8 @@ limitations under the License. #include "tensorflow/core/framework/tensor.pb.h" // NOLINT #include "tensorflow/core/framework/types.h" #include "tensorflow/core/graph/graph.h" -#include "tensorflow/core/lib/strings/base64.h" -#include "tensorflow/core/lib/strings/strcat.h" +#include "tensorflow/core/platform/base64.h" +#include "tensorflow/core/platform/strcat.h" using tensorflow::errors::InvalidArgument; diff --git a/tensorflow/c/c_api_function_test.cc b/tensorflow/c/c_api_function_test.cc index 79bc34c683b..bbf645200c6 100644 --- a/tensorflow/c/c_api_function_test.cc +++ b/tensorflow/c/c_api_function_test.cc @@ -14,17 +14,16 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/c/c_api.h" - #include "tensorflow/c/c_api_internal.h" #include "tensorflow/c/c_test_util.h" #include "tensorflow/core/framework/function.pb.h" #include "tensorflow/core/framework/op_def.pb.h" -#include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/lib/hash/hash.h" #include "tensorflow/core/lib/strings/proto_serialization.h" -#include "tensorflow/core/lib/strings/str_util.h" -#include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/status.h" +#include "tensorflow/core/platform/str_util.h" +#include "tensorflow/core/platform/strcat.h" #include "tensorflow/core/platform/test.h" namespace tensorflow { diff --git a/tensorflow/c/c_api_internal.h b/tensorflow/c/c_api_internal.h index 32880378c2b..db134e0ed74 100644 --- a/tensorflow/c/c_api_internal.h +++ b/tensorflow/c/c_api_internal.h @@ -40,8 +40,8 @@ limitations under the License. #include "tensorflow/core/graph/graph.h" #include "tensorflow/core/graph/graph_constructor.h" #include "tensorflow/core/graph/node_builder.h" -#include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/platform/mutex.h" +#include "tensorflow/core/platform/status.h" #include "tensorflow/core/platform/types.h" #include "tensorflow/core/public/session.h" diff --git a/tensorflow/c/c_api_test.cc b/tensorflow/c/c_api_test.cc index 90b4bbe0716..0fc07b87070 100644 --- a/tensorflow/c/c_api_test.cc +++ b/tensorflow/c/c_api_test.cc @@ -43,10 +43,10 @@ limitations under the License. #include "tensorflow/core/graph/tensor_id.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/lib/io/path.h" -#include "tensorflow/core/lib/strings/str_util.h" -#include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/platform/path.h" #include "tensorflow/core/platform/resource_loader.h" +#include "tensorflow/core/platform/str_util.h" +#include "tensorflow/core/platform/strcat.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/protobuf/error_codes.pb.h" #include "tensorflow/core/protobuf/meta_graph.pb.h" diff --git a/tensorflow/c/c_test_util.cc b/tensorflow/c/c_test_util.cc index f15d9ee20ad..cb5bc0dac76 100644 --- a/tensorflow/c/c_test_util.cc +++ b/tensorflow/c/c_test_util.cc @@ -19,8 +19,8 @@ limitations under the License. #include "tensorflow/core/framework/function.pb.h" #include "tensorflow/core/framework/op_def.pb.h" #include "tensorflow/core/framework/tensor.pb.h" -#include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/strcat.h" #include "tensorflow/core/public/session_options.h" using tensorflow::GraphDef; diff --git a/tensorflow/c/checkpoint_reader.cc b/tensorflow/c/checkpoint_reader.cc index 1a92efb89bc..4a613d874a2 100644 --- a/tensorflow/c/checkpoint_reader.cc +++ b/tensorflow/c/checkpoint_reader.cc @@ -18,9 +18,9 @@ limitations under the License. #include #include -#include "tensorflow/core/lib/core/status.h" -#include "tensorflow/core/lib/core/stringpiece.h" #include "tensorflow/core/platform/env.h" +#include "tensorflow/core/platform/status.h" +#include "tensorflow/core/platform/stringpiece.h" #include "tensorflow/core/platform/types.h" #include "tensorflow/core/util/saved_tensor_slice_util.h" diff --git a/tensorflow/c/checkpoint_reader.h b/tensorflow/c/checkpoint_reader.h index 0e613db7719..517cd3400ca 100644 --- a/tensorflow/c/checkpoint_reader.h +++ b/tensorflow/c/checkpoint_reader.h @@ -21,7 +21,7 @@ limitations under the License. #include "tensorflow/c/tf_status_helper.h" #include "tensorflow/core/framework/tensor_shape.h" -#include "tensorflow/core/lib/core/status.h" +#include "tensorflow/core/platform/status.h" #include "tensorflow/core/platform/types.h" #include "tensorflow/core/util/tensor_bundle/tensor_bundle.h" #include "tensorflow/core/util/tensor_slice_reader.h" diff --git a/tensorflow/c/eager/c_api.cc b/tensorflow/c/eager/c_api.cc index a38bdc6cbb0..e9f008cd482 100644 --- a/tensorflow/c/eager/c_api.cc +++ b/tensorflow/c/eager/c_api.cc @@ -21,29 +21,23 @@ limitations under the License. #include #include -// clang-format off -// Required for IS_MOBILE_PLATFORM -#include "tensorflow/core/platform/platform.h" -// clang-format on - #include "absl/algorithm/container.h" #include "absl/memory/memory.h" #include "tensorflow/c/c_api.h" #include "tensorflow/c/c_api_internal.h" -#include "tensorflow/c/eager/tensor_handle_interface.h" -#include "tensorflow/c/tf_tensor_internal.h" #include "tensorflow/c/eager/c_api_experimental.h" #include "tensorflow/c/eager/c_api_internal.h" +#include "tensorflow/c/eager/tensor_handle_interface.h" +#include "tensorflow/c/tf_tensor_internal.h" #include "tensorflow/core/common_runtime/device.h" #include "tensorflow/core/common_runtime/eager/context.h" #include "tensorflow/core/framework/device_attributes.pb.h" -#include "tensorflow/core/lib/core/errors.h" -#include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/framework/function.h" #include "tensorflow/core/platform/errors.h" -#include "tensorflow/core/platform/platform.h" // NOLINT -#include "tensorflow/core/protobuf/error_codes.pb.h" +#include "tensorflow/core/platform/platform.h" +#include "tensorflow/core/platform/status.h" #include "tensorflow/core/protobuf/device_filters.pb.h" +#include "tensorflow/core/protobuf/error_codes.pb.h" #include "tensorflow/core/util/device_name_utils.h" #ifdef TENSORFLOW_EAGER_USE_XLA #include "tensorflow/compiler/tf2xla/xla_op_registry.h" @@ -73,18 +67,17 @@ limitations under the License. #include "tensorflow/core/framework/rendezvous.h" #include "tensorflow/core/framework/tensor_shape.pb.h" #include "tensorflow/core/framework/types.h" -#include "tensorflow/core/lib/core/blocking_counter.h" -#include "tensorflow/core/lib/core/notification.h" -#include "tensorflow/core/lib/core/refcount.h" -#include "tensorflow/core/lib/core/stringpiece.h" #include "tensorflow/core/lib/gtl/cleanup.h" #include "tensorflow/core/lib/gtl/flatmap.h" #include "tensorflow/core/lib/gtl/map_util.h" - -#include "tensorflow/core/lib/random/random.h" +#include "tensorflow/core/platform/blocking_counter.h" #include "tensorflow/core/platform/casts.h" #include "tensorflow/core/platform/env.h" #include "tensorflow/core/platform/mutex.h" +#include "tensorflow/core/platform/notification.h" +#include "tensorflow/core/platform/random.h" +#include "tensorflow/core/platform/refcount.h" +#include "tensorflow/core/platform/stringpiece.h" #include "tensorflow/core/platform/thread_annotations.h" #include "tensorflow/core/profiler/lib/traceme.h" #include "tensorflow/core/public/version.h" diff --git a/tensorflow/c/eager/c_api_experimental.cc b/tensorflow/c/eager/c_api_experimental.cc index 4d01a066642..0254cc86199 100644 --- a/tensorflow/c/eager/c_api_experimental.cc +++ b/tensorflow/c/eager/c_api_experimental.cc @@ -22,9 +22,9 @@ limitations under the License. #include "tensorflow/core/lib/monitoring/counter.h" #include "tensorflow/core/lib/monitoring/gauge.h" #include "tensorflow/core/lib/monitoring/sampler.h" -#include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/platform/casts.h" #include "tensorflow/core/platform/mutex.h" +#include "tensorflow/core/platform/strcat.h" using tensorflow::string; diff --git a/tensorflow/c/eager/c_api_experimental_test.cc b/tensorflow/c/eager/c_api_experimental_test.cc index cf71863e124..6e2063db35e 100644 --- a/tensorflow/c/eager/c_api_experimental_test.cc +++ b/tensorflow/c/eager/c_api_experimental_test.cc @@ -21,9 +21,9 @@ limitations under the License. #include "tensorflow/c/eager/c_api_test_util.h" #include "tensorflow/cc/profiler/profiler.h" #include "tensorflow/core/lib/monitoring/collection_registry.h" -#include "tensorflow/core/lib/strings/str_util.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/protobuf.h" +#include "tensorflow/core/platform/str_util.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/platform/test_benchmark.h" diff --git a/tensorflow/c/eager/c_api_internal.h b/tensorflow/c/eager/c_api_internal.h index 754fea1aad5..4b9726e17a8 100644 --- a/tensorflow/c/eager/c_api_internal.h +++ b/tensorflow/c/eager/c_api_internal.h @@ -40,14 +40,14 @@ limitations under the License. #include "tensorflow/core/common_runtime/rendezvous_mgr.h" #include "tensorflow/core/framework/cancellation.h" #include "tensorflow/core/framework/rendezvous.h" -#include "tensorflow/core/lib/core/errors.h" -#include "tensorflow/core/lib/core/stringpiece.h" #include "tensorflow/core/lib/gtl/inlined_vector.h" #include "tensorflow/core/lib/gtl/map_util.h" #include "tensorflow/core/lib/monitoring/counter.h" #include "tensorflow/core/lib/monitoring/gauge.h" #include "tensorflow/core/lib/monitoring/sampler.h" +#include "tensorflow/core/platform/errors.h" #include "tensorflow/core/platform/mutex.h" +#include "tensorflow/core/platform/stringpiece.h" #include "tensorflow/core/platform/thread_annotations.h" #include "tensorflow/core/public/version.h" diff --git a/tensorflow/c/eager/c_api_test.cc b/tensorflow/c/eager/c_api_test.cc index 4664af87fa3..c5eda8b607a 100644 --- a/tensorflow/c/eager/c_api_test.cc +++ b/tensorflow/c/eager/c_api_test.cc @@ -24,11 +24,11 @@ limitations under the License. #include "tensorflow/c/eager/c_api_internal.h" #include "tensorflow/c/eager/c_api_test_util.h" #include "tensorflow/core/framework/function.pb.h" -#include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/platform/casts.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/macros.h" #include "tensorflow/core/platform/protobuf.h" +#include "tensorflow/core/platform/strcat.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/platform/test_benchmark.h" #include "tensorflow/core/protobuf/cluster.pb.h" diff --git a/tensorflow/c/eager/c_api_unified_experimental.cc b/tensorflow/c/eager/c_api_unified_experimental.cc index e501f70a0f2..9c472551bc6 100644 --- a/tensorflow/c/eager/c_api_unified_experimental.cc +++ b/tensorflow/c/eager/c_api_unified_experimental.cc @@ -24,9 +24,9 @@ limitations under the License. #include "tensorflow/core/lib/monitoring/counter.h" #include "tensorflow/core/lib/monitoring/gauge.h" #include "tensorflow/core/lib/monitoring/sampler.h" -#include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/platform/casts.h" #include "tensorflow/core/platform/mutex.h" +#include "tensorflow/core/platform/strcat.h" using tensorflow::string; diff --git a/tensorflow/c/eager/c_api_unified_experimental_test.cc b/tensorflow/c/eager/c_api_unified_experimental_test.cc index 58b4237e119..d9066464e8e 100644 --- a/tensorflow/c/eager/c_api_unified_experimental_test.cc +++ b/tensorflow/c/eager/c_api_unified_experimental_test.cc @@ -21,9 +21,9 @@ limitations under the License. #include "tensorflow/c/eager/c_api_test_util.h" #include "tensorflow/cc/profiler/profiler.h" #include "tensorflow/core/lib/monitoring/collection_registry.h" -#include "tensorflow/core/lib/strings/str_util.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/protobuf.h" +#include "tensorflow/core/platform/str_util.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/platform/test_benchmark.h" diff --git a/tensorflow/c/experimental/network.cc b/tensorflow/c/experimental/network.cc index 9dfce1b63f6..94375cf9983 100644 --- a/tensorflow/c/experimental/network.cc +++ b/tensorflow/c/experimental/network.cc @@ -24,8 +24,8 @@ limitations under the License. #include "tensorflow/core/distributed_runtime/rpc/grpc_server_lib.h" #include "tensorflow/core/distributed_runtime/server_lib.h" #include "tensorflow/core/distributed_runtime/worker_env.h" -#include "tensorflow/core/lib/core/errors.h" -#include "tensorflow/core/lib/core/status.h" +#include "tensorflow/core/platform/errors.h" +#include "tensorflow/core/platform/status.h" using tensorflow::ServerFactory; diff --git a/tensorflow/c/experimental/network_internal.h b/tensorflow/c/experimental/network_internal.h index c2575296397..389de440b70 100644 --- a/tensorflow/c/experimental/network_internal.h +++ b/tensorflow/c/experimental/network_internal.h @@ -22,8 +22,8 @@ limitations under the License. #include "tensorflow/c/experimental/rendezvous.h" #include "tensorflow/core/distributed_runtime/rpc/grpc_server_lib.h" #include "tensorflow/core/distributed_runtime/server_lib.h" -#include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/platform/env.h" +#include "tensorflow/core/platform/status.h" #include "tensorflow/core/protobuf/tensorflow_server.pb.h" namespace tensorflow { diff --git a/tensorflow/c/experimental/network_test.cc b/tensorflow/c/experimental/network_test.cc index 39f7e646d28..b7a50008c37 100644 --- a/tensorflow/c/experimental/network_test.cc +++ b/tensorflow/c/experimental/network_test.cc @@ -37,9 +37,9 @@ limitations under the License. #include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/framework/rendezvous.h" #include "tensorflow/core/framework/tensor.h" -#include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/lib/core/status_test_util.h" -#include "tensorflow/core/lib/strings/strcat.h" +#include "tensorflow/core/platform/status.h" +#include "tensorflow/core/platform/strcat.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/protobuf/cluster.pb.h" #include "tensorflow/core/protobuf/tensorflow_server.pb.h" diff --git a/tensorflow/c/experimental/rendezvous.cc b/tensorflow/c/experimental/rendezvous.cc index 7a90bde8fe4..c996cfb44f3 100644 --- a/tensorflow/c/experimental/rendezvous.cc +++ b/tensorflow/c/experimental/rendezvous.cc @@ -24,9 +24,9 @@ limitations under the License. #include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/framework/rendezvous.h" #include "tensorflow/core/framework/tensor.h" -#include "tensorflow/core/lib/core/errors.h" -#include "tensorflow/core/lib/core/status.h" -#include "tensorflow/core/lib/core/stringpiece.h" +#include "tensorflow/core/platform/errors.h" +#include "tensorflow/core/platform/status.h" +#include "tensorflow/core/platform/stringpiece.h" namespace tensorflow { diff --git a/tensorflow/c/tf_tensor.cc b/tensorflow/c/tf_tensor.cc index 03833368102..1425c956e8c 100644 --- a/tensorflow/c/tf_tensor.cc +++ b/tensorflow/c/tf_tensor.cc @@ -26,7 +26,7 @@ limitations under the License. #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/framework/tensor_shape.pb.h" #include "tensorflow/core/framework/types.pb.h" -#include "tensorflow/core/lib/core/coding.h" +#include "tensorflow/core/platform/coding.h" using tensorflow::Status; using tensorflow::Tensor; diff --git a/tensorflow/c/while_loop_test.cc b/tensorflow/c/while_loop_test.cc index d2d887f32c4..687c73d8b4e 100644 --- a/tensorflow/c/while_loop_test.cc +++ b/tensorflow/c/while_loop_test.cc @@ -14,10 +14,9 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/c/c_api.h" - #include "tensorflow/c/c_test_util.h" -#include "tensorflow/core/lib/strings/strcat.h" #include "tensorflow/core/platform/logging.h" +#include "tensorflow/core/platform/strcat.h" #include "tensorflow/core/platform/test.h" using tensorflow::GraphDef; diff --git a/tensorflow/core/platform/BUILD b/tensorflow/core/platform/BUILD index 87b64868c76..874f1f2092c 100644 --- a/tensorflow/core/platform/BUILD +++ b/tensorflow/core/platform/BUILD @@ -1263,7 +1263,9 @@ filegroup( name = "lib_hdrs", srcs = [ "abi.h", + "base64.h", "casts.h", + "coding.h", "context.h", "cord.h", "cpu_feature_guard.h", @@ -1291,6 +1293,7 @@ filegroup( "profile_utils/cpu_utils.h", "profile_utils/i_cpu_utils_helper.h", "protobuf.h", + "random.h", "resource.h", "stacktrace.h", "stacktrace_handler.h",