• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("//tensorflow:tensorflow.bzl", "filegroup")
2load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
3load(
4    "@io_bazel_rules_closure//closure:defs.bzl",
5    "closure_proto_library",
6)
7load(
8    "//tensorflow:tensorflow.bzl",
9    "tf_cc_test",
10    "tf_copts",
11)
12load(
13    "//tensorflow/core/platform:build_config.bzl",
14    "tf_jspb_proto_library",
15    "tf_proto_library",
16    "tf_pyclif_proto_library",
17)
18
19package(
20    default_visibility = [
21        "//visibility:public",
22    ],
23    licenses = ["notice"],
24)
25
26# TODO(bmzhao): Refactor this target to use granular dependencies
27# after stage 4 of the TF build refactor is complete:
28# https://github.com/tensorflow/community/pull/179
29cc_library(
30    name = "example_parser_configuration",
31    srcs = ["example_parser_configuration.cc"],
32    hdrs = ["example_parser_configuration.h"],
33    copts = tf_copts(),
34    linkstatic = 1,
35    deps = [
36        "//tensorflow/core:core_cpu",
37        "//tensorflow/core:core_cpu_internal",
38        "//tensorflow/core:framework",
39        "//tensorflow/core:lib",
40        "//tensorflow/core:lib_internal",
41        "//tensorflow/core:protos_all_cc",
42    ],
43    alwayslink = 1,
44)
45
46cc_library(
47    name = "feature_util",
48    srcs = ["feature_util.cc"],
49    hdrs = ["feature_util.h"],
50    deps = [
51        ":example_protos_cc",
52        "//tensorflow/core/platform:protobuf",
53        "//tensorflow/core/platform:stringpiece",
54        "//tensorflow/core/platform:types",
55        "@com_google_absl//absl/base:core_headers",
56    ],
57    alwayslink = 1,
58)
59
60# TODO(bmzhao): Refactor this target to use granular dependencies
61# after stage 4 of the TF build refactor is complete:
62# https://github.com/tensorflow/community/pull/179
63tf_cc_test(
64    name = "example_parser_configuration_test",
65    size = "small",
66    srcs = ["example_parser_configuration_test.cc"],
67    data = [":example_parser_configuration_testdata"],
68    deps = [
69        "//tensorflow/cc:cc_ops",
70        "//tensorflow/core:core_cpu",
71        "//tensorflow/core:core_cpu_internal",
72        "//tensorflow/core:example_parser_configuration",
73        "//tensorflow/core:framework",
74        "//tensorflow/core:framework_internal",
75        "//tensorflow/core:lib",
76        "//tensorflow/core:lib_internal",
77        "//tensorflow/core:ops",
78        "//tensorflow/core:protos_all_cc",
79        "//tensorflow/core:test",
80        "//tensorflow/core:test_main",
81        "//tensorflow/core:testlib",
82        "//tensorflow/core/common_runtime:direct_session_internal",
83        "//tensorflow/core/kernels:example_parsing_ops",
84    ],
85)
86
87alias(
88    name = "example_parser_configuration_testdata",
89    actual = "//tensorflow/core/example/testdata:example_parser_configuration_testdata",
90)
91
92tf_proto_library(
93    name = "example_protos",
94    srcs = [
95        "example.proto",
96        "feature.proto",
97    ],
98    cc_api_version = 2,
99    make_default_target_header_only = True,
100    tags = ["alt_dep=//third_party/tensorflow/core:protos_all"],
101)
102
103tf_proto_library(
104    name = "example_parser_configuration_proto",
105    srcs = ["example_parser_configuration.proto"],
106    cc_api_version = 2,
107    make_default_target_header_only = True,
108    protodeps = [
109        "//tensorflow/core/framework:tensor_shape_proto",
110        "//tensorflow/core/framework:tensor_proto",
111        "//tensorflow/core/framework:types_proto",
112    ],
113)
114
115tf_proto_library(
116    name = "protos_all",
117    cc_api_version = 2,
118    make_default_target_header_only = True,
119    protodeps = [
120        ":example_protos",
121        ":example_parser_configuration_proto",
122    ],
123    tags = [
124        "alt_dep=//third_party/tensorflow/core:protos_all",
125    ],
126)
127
128tf_pyclif_proto_library(
129    name = "example_pyclif",
130    proto_lib = "//tensorflow/core:protos_all",
131    proto_srcfile = "example.proto",
132)
133
134tf_pyclif_proto_library(
135    name = "feature_pyclif",
136    proto_lib = "//tensorflow/core:protos_all",
137    proto_srcfile = "feature.proto",
138)
139
140tf_jspb_proto_library(
141    name = "example_jspb_proto",
142    deps = [":example_protos"],
143)
144
145closure_proto_library(
146    name = "example_protos_closure",
147    deps = [":example_protos"],
148)
149
150filegroup(
151    name = "mobile_srcs_no_runtime",
152    srcs = [
153        "feature_util.cc",
154        "feature_util.h",
155    ],
156)
157
158# TODO(bmzhao): These files are exported since they are directly referenced
159# from targets in tensorflow/core/BUILD. Remove these after phase 4 of the
160# TF refactor: https://github.com/tensorflow/community/pull/179
161exports_files(
162    srcs = [
163        "example.proto",
164        "example_parser_configuration_test.cc",
165        "feature.proto",
166        "feature_util.cc",
167        "feature_util.h",
168        "feature_util_test.cc",
169    ],
170    visibility = [
171        "//tensorflow/core:__pkg__",
172    ],
173)
174