• 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        "@com_google_absl//absl/strings",
55    ],
56    alwayslink = 1,
57)
58
59# TODO(bmzhao): Refactor this target to use granular dependencies
60# after stage 4 of the TF build refactor is complete:
61# https://github.com/tensorflow/community/pull/179
62tf_cc_test(
63    name = "example_parser_configuration_test",
64    size = "small",
65    srcs = ["example_parser_configuration_test.cc"],
66    data = [":example_parser_configuration_testdata"],
67    deps = [
68        "//tensorflow/cc:cc_ops",
69        "//tensorflow/core:core_cpu",
70        "//tensorflow/core:core_cpu_internal",
71        "//tensorflow/core:example_parser_configuration",
72        "//tensorflow/core:framework",
73        "//tensorflow/core:framework_internal",
74        "//tensorflow/core:lib",
75        "//tensorflow/core:lib_internal",
76        "//tensorflow/core:ops",
77        "//tensorflow/core:protos_all_cc",
78        "//tensorflow/core:test",
79        "//tensorflow/core:test_main",
80        "//tensorflow/core:testlib",
81        "//tensorflow/core/common_runtime:direct_session_internal",
82        "//tensorflow/core/kernels:example_parsing_ops",
83    ],
84)
85
86alias(
87    name = "example_parser_configuration_testdata",
88    actual = "//tensorflow/core/example/testdata:example_parser_configuration_testdata",
89)
90
91tf_proto_library(
92    name = "example_protos",
93    srcs = [
94        "example.proto",
95        "feature.proto",
96    ],
97    cc_api_version = 2,
98    make_default_target_header_only = True,
99    tags = ["alt_dep=//third_party/tensorflow/core:protos_all"],
100)
101
102tf_proto_library(
103    name = "example_parser_configuration_proto",
104    srcs = ["example_parser_configuration.proto"],
105    cc_api_version = 2,
106    make_default_target_header_only = True,
107    protodeps = [
108        "//tensorflow/core/framework:tensor_shape_proto",
109        "//tensorflow/core/framework:tensor_proto",
110        "//tensorflow/core/framework:types_proto",
111    ],
112)
113
114tf_proto_library(
115    name = "protos_all",
116    cc_api_version = 2,
117    make_default_target_header_only = True,
118    protodeps = [
119        ":example_protos",
120        ":example_parser_configuration_proto",
121    ],
122    tags = [
123        "alt_dep=//third_party/tensorflow/core:protos_all",
124    ],
125)
126
127tf_pyclif_proto_library(
128    name = "example_pyclif",
129    proto_lib = "//tensorflow/core:protos_all",
130    proto_srcfile = "example.proto",
131)
132
133tf_pyclif_proto_library(
134    name = "feature_pyclif",
135    proto_lib = "//tensorflow/core:protos_all",
136    proto_srcfile = "feature.proto",
137)
138
139tf_jspb_proto_library(
140    name = "example_jspb_proto",
141    deps = [":example_protos"],
142)
143
144closure_proto_library(
145    name = "example_protos_closure",
146    deps = [":example_protos"],
147)
148
149filegroup(
150    name = "mobile_srcs_no_runtime",
151    srcs = [
152        "feature_util.cc",
153        "feature_util.h",
154    ],
155)
156
157# TODO(bmzhao): These files are exported since they are directly referenced
158# from targets in tensorflow/core/BUILD. Remove these after phase 4 of the
159# TF refactor: https://github.com/tensorflow/community/pull/179
160exports_files(
161    srcs = [
162        "example.proto",
163        "example_parser_configuration_test.cc",
164        "feature.proto",
165        "feature_util.cc",
166        "feature_util.h",
167        "feature_util_test.cc",
168    ],
169    visibility = [
170        "//tensorflow/core:__pkg__",
171    ],
172)
173