Remove a bunch of proto.h includes from tensorflow/core headers

The goal is to make kernels mostly independent of proto headers, which will let us lock down our .so imports.

RELNOTES: Remove proto.h includes from tensorflow/core headers. This may break users who has written custom c++ ops.
PiperOrigin-RevId: 166237236
This commit is contained in:
Gunhan Gulsoy 2017-08-23 12:24:52 -07:00 committed by TensorFlower Gardener
parent e2a4c81247
commit 008343bd95
36 changed files with 22 additions and 31 deletions

View File

@ -20,9 +20,12 @@ limitations under the License.
#include <unordered_map>
#include "tensorflow/compiler/aot/tfcompile.pb.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/tensor_shape.h"
#include "tensorflow/core/framework/tensor_shape.pb.h"
#include "tensorflow/core/framework/versions.pb.h"
#include "tensorflow/core/graph/tensor_id.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/core/status.h"

View File

@ -388,6 +388,7 @@ cc_library(
":feature-stats-accumulator",
"//tensorflow/contrib/boosted_trees/proto:learner_proto_cc",
"//tensorflow/core:framework_headers_lib",
"//tensorflow/core:protos_all_cc",
],
)

View File

@ -20,6 +20,7 @@
#include "tensorflow/contrib/boosted_trees/lib/learner/common/accumulators/feature-stats-accumulator.h"
#include "tensorflow/contrib/boosted_trees/lib/learner/stochastic/stats/feature-split-candidate.h"
#include "tensorflow/contrib/boosted_trees/proto/learner.pb.h"
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/tensor_types.h"

View File

@ -22,6 +22,7 @@ limitations under the License.
#include "tensorflow/core/framework/common_shape_fns.h"
#include "tensorflow/core/framework/node_def.pb.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/tensor.pb.h"
#include "tensorflow/core/framework/versions.pb.h"
#include "tensorflow/core/kernels/bounds_check.h"
#include "tensorflow/core/lib/core/errors.h"

View File

@ -20,7 +20,6 @@ limitations under the License.
#include <string>
#include <vector>
#include "tensorflow/core/framework/attr_value.pb.h" // TODO(62899350): Remove
#include "tensorflow/core/framework/partial_tensor_shape.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/tensor_shape.h"

View File

@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "tensorflow/core/framework/common_shape_fns.h"
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/util/tensor_format.h"
namespace tensorflow {

View File

@ -20,9 +20,7 @@ limitations under the License.
#include <string>
#include <unordered_map>
#include "tensorflow/core/framework/device_attributes.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/tensor.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/core/refcount.h"
#include "tensorflow/core/lib/core/status.h"

View File

@ -20,7 +20,6 @@ limitations under the License.
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/framework/attr_value_util.h"
#include "tensorflow/core/framework/function.pb.h"
#include "tensorflow/core/framework/graph.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/node_def_util.h"
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/selective_registration.h"

View File

@ -17,7 +17,6 @@ limitations under the License.
#define TENSORFLOW_FRAMEWORK_GRAPH_DEF_UTIL_H_
#include <set>
#include "tensorflow/core/framework/graph.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/lib/core/status.h"

View File

@ -16,7 +16,6 @@ limitations under the License.
#ifndef TENSORFLOW_FRAMEWORK_KERNEL_DEF_BUILDER_H_
#define TENSORFLOW_FRAMEWORK_KERNEL_DEF_BUILDER_H_
#include "tensorflow/core/framework/kernel_def.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/lib/gtl/array_slice.h"
#include "tensorflow/core/platform/macros.h"

View File

@ -16,7 +16,6 @@ limitations under the License.
#ifndef TENSORFLOW_FRAMEWORK_MEMORY_TYPES_H_
#define TENSORFLOW_FRAMEWORK_MEMORY_TYPES_H_
#include "tensorflow/core/framework/graph.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/types.h"

View File

@ -19,7 +19,6 @@ limitations under the License.
#include <functional>
#include <vector>
#include "tensorflow/core/framework/attr_value_util.h"
#include "tensorflow/core/framework/graph.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/node_def.pb.h"
#include "tensorflow/core/framework/node_def_util.h"
#include "tensorflow/core/framework/op.h"

View File

@ -21,7 +21,6 @@ limitations under the License.
#include <vector>
#include "tensorflow/core/framework/attr_value_util.h"
#include "tensorflow/core/framework/op_def.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/lib/core/stringpiece.h"
#include "tensorflow/core/platform/protobuf.h"

View File

@ -20,7 +20,6 @@ limitations under the License.
#include <unordered_map>
#include <vector>
#include "tensorflow/core/framework/op_def.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/op_def_builder.h"
#include "tensorflow/core/framework/op_def_util.h"
#include "tensorflow/core/framework/selective_registration.h"

View File

@ -18,8 +18,6 @@ limitations under the License.
#include <string>
#include <unordered_map>
#include "tensorflow/core/framework/op_def.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/op_gen_overrides.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/lib/core/status.h"
#include "tensorflow/core/lib/core/stringpiece.h"
#include "tensorflow/core/platform/env.h"

View File

@ -24,16 +24,12 @@ limitations under the License.
#include "tensorflow/core/framework/cancellation.h"
#include "tensorflow/core/framework/control_flow.h"
#include "tensorflow/core/framework/device_base.h"
#include "tensorflow/core/framework/function.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/graph.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/kernel_def.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/kernel_def_builder.h"
#include "tensorflow/core/framework/node_def_util.h"
#include "tensorflow/core/framework/op.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/rendezvous.h"
#include "tensorflow/core/framework/selective_registration.h"
#include "tensorflow/core/framework/session_state.h"
#include "tensorflow/core/framework/step_stats.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/tensor_shape.h"
#include "tensorflow/core/framework/tensor_shape.pb.h" // TODO(b/62899350): Remove

View File

@ -19,7 +19,6 @@ limitations under the License.
#include <memory>
#include <string>
#include "tensorflow/core/framework/queue_interface.h"
#include "tensorflow/core/framework/reader_base.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/reader_interface.h"
#include "tensorflow/core/lib/core/stringpiece.h"

View File

@ -22,7 +22,6 @@ limitations under the License.
#include <unordered_map>
#include "tensorflow/core/framework/common_shape_fns.h"
#include "tensorflow/core/framework/graph.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/resource_handle.h"
#include "tensorflow/core/framework/tensor.h"

View File

@ -17,7 +17,6 @@ limitations under the License.
#include <vector>
#include "tensorflow/core/framework/graph.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/node_def_util.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/lib/core/errors.h"

View File

@ -17,10 +17,7 @@ limitations under the License.
#define TENSORFLOW_CORE_FRAMEWORK_TENSOR_H_
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
#include "tensorflow/core/framework/allocation_description.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/allocator.h"
#include "tensorflow/core/framework/tensor.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/tensor_description.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/tensor_shape.h"
#include "tensorflow/core/framework/tensor_types.h"
#include "tensorflow/core/framework/types.h"

View File

@ -19,7 +19,6 @@ limitations under the License.
#include <string>
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
#include "tensorflow/core/framework/tensor_shape.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/types.pb.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/core/status.h"

View File

@ -14,6 +14,7 @@ limitations under the License.
==============================================================================*/
#include "tensorflow/core/framework/variant.h"
#include "tensorflow/core/framework/tensor.pb.h"
#include "tensorflow/core/framework/variant_encode_decode.h"
#include "tensorflow/core/framework/variant_tensor_data.h"
#include "tensorflow/core/lib/core/errors.h"

View File

@ -23,6 +23,7 @@ limitations under the License.
#include <unordered_map>
#include <utility>
#include "tensorflow/core/framework/tensor.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/type_index.h"
#include "tensorflow/core/framework/variant_tensor_data.h"
#include "tensorflow/core/lib/core/status.h"

View File

@ -15,6 +15,7 @@ limitations under the License.
#include "tensorflow/core/framework/variant_tensor_data.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/tensor.pb.h"
#include "tensorflow/core/lib/strings/strcat.h"
namespace tensorflow {

View File

@ -20,6 +20,8 @@ limitations under the License.
#include "tensorflow/core/framework/variant_tensor_data.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/tensor.pb.h"
#include "tensorflow/core/framework/tensor_shape.pb.h"
#include "tensorflow/core/lib/core/coding.h"
#include "tensorflow/core/platform/test.h"

View File

@ -16,7 +16,6 @@ limitations under the License.
#ifndef TENSORFLOW_FRAMEWORK_VERSIONS_H_
#define TENSORFLOW_FRAMEWORK_VERSIONS_H_
#include "tensorflow/core/framework/versions.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/lib/core/status.h"
namespace tensorflow {

View File

@ -41,10 +41,8 @@ limitations under the License.
#include <string>
#include <vector>
#include "tensorflow/core/framework/function.h"
#include "tensorflow/core/framework/graph.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/framework/versions.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/graph/edgeset.h"
#include "tensorflow/core/lib/core/arena.h"
#include "tensorflow/core/lib/core/refcount.h"

View File

@ -245,6 +245,7 @@ cc_library(
deps = [
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
"//third_party/eigen3",
],
)
@ -1332,6 +1333,7 @@ tf_kernel_library(
deps = [
":ops_util",
"//tensorflow/core:framework",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core/kernels:conv_ops",
"//third_party/eigen3",
],

View File

@ -191,7 +191,7 @@ class BiasGradOp : public OpKernel {
data_format_ = FORMAT_NHWC;
}
OP_REQUIRES(context, data_format_ == FORMAT_NHWC,
errors::InvalidArgument(context->device()->attributes().name() +
errors::InvalidArgument(context->device()->name() +
" BiasGradOp only supports NHWC."));
}

View File

@ -15,6 +15,7 @@ limitations under the License.
#include "tensorflow/core/kernels/hexagon/hexagon_control_wrapper.h"
#include "tensorflow/core/framework/tensor_shape.pb.h"
#include "tensorflow/core/kernels/hexagon/hexagon_ops_definitions.h"
#include "tensorflow/core/kernels/hexagon/soc_interface.h"
#include "tensorflow/core/platform/profile_utils/cpu_utils.h"

View File

@ -16,6 +16,7 @@ limitations under the License.
#include <algorithm>
#include <cmath>
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/kernels/ops_util.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/strings/str_util.h"

View File

@ -15,9 +15,10 @@ limitations under the License.
#define EIGEN_USE_THREADS
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/framework/register_types.h"
#include "tensorflow/core/kernels/tile_functor.h"
#include "tensorflow/core/kernels/ops_util.h"
#include "tensorflow/core/kernels/tile_functor.h"
namespace tensorflow {

View File

@ -15,8 +15,9 @@ limitations under the License.
#define EIGEN_USE_THREADS
#include "tensorflow/core/kernels/transpose_functor.h"
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/kernels/ops_util.h"
#include "tensorflow/core/kernels/transpose_functor.h"
namespace tensorflow {
namespace internal {

View File

@ -16,7 +16,6 @@ limitations under the License.
#ifndef TENSORFLOW_GRAPH_EQUAL_GRAPH_DEF_H_
#define TENSORFLOW_GRAPH_EQUAL_GRAPH_DEF_H_
#include "tensorflow/core/framework/graph.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/framework/graph_def_util.h"
#include "tensorflow/core/platform/protobuf.h"
#include "tensorflow/core/platform/types.h"

View File

@ -15,6 +15,7 @@ limitations under the License.
#include "tensorflow/core/util/padding.h"
#include "tensorflow/core/framework/attr_value.pb.h"
#include "tensorflow/core/framework/node_def_util.h"
#include "tensorflow/core/lib/core/errors.h"

View File

@ -21,7 +21,6 @@ limitations under the License.
#include <string>
#include "tensorflow/core/framework/graph.pb.h" // TODO(b/62899350): Remove
#include "tensorflow/core/lib/core/status.h"
namespace tensorflow {