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"], # Apache 2.0 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) 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