Create a new BUILD file under tensorflow/core/ops

PiperOrigin-RevId: 336931765
Change-Id: I2571effa8bba2d25b9e2d67a37e57f13beaa3b47
This commit is contained in:
Gunhan Gulsoy 2020-10-13 12:31:35 -07:00 committed by TensorFlower Gardener
parent d871221f2f
commit 21b7abe1b6
3 changed files with 637 additions and 504 deletions

View File

@ -84,9 +84,6 @@ load(
# buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "cc_header_only_library")
# buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "tf_gen_op_libs")
# buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "if_nccl")
@ -161,7 +158,6 @@ package_group(
# Export the BUILD file so automated tooling can check licenses
exports_files([
"BUILD",
"ops/ops.pbtxt",
])
# Authorized users go here.
@ -551,157 +547,7 @@ cc_library(
],
)
# Generates library per group of ops.
tf_gen_op_libs(
is_external = False,
op_lib_names = [
"batch_ops",
"bitwise_ops",
"boosted_trees_ops",
"tensor_forest_ops",
"candidate_sampling_ops",
"checkpoint_ops",
"clustering_ops",
"collective_ops",
"control_flow_ops",
"count_ops",
"ctc_ops",
"data_flow_ops",
"dataset_ops",
"decode_proto_ops",
"encode_proto_ops",
"experimental_dataset_ops",
"function_ops",
"functional_ops",
"image_ops",
"io_ops",
"linalg_ops",
"list_ops",
"map_ops",
"lookup_ops",
"manip_ops",
"math_ops",
"mkl_nn_ops",
"nccl_ops",
"nn_ops",
"no_op",
"parsing_ops",
"random_grad",
"random_ops",
"special_math_ops",
"stateful_random_ops",
"remote_fused_graph_ops",
"rnn_ops",
"rpc_ops",
"scoped_allocator_ops",
"sdca_ops",
"set_ops",
"script_ops",
"sendrecv_ops",
"sparse_csr_matrix_ops",
"sparse_ops",
"spectral_ops",
"state_ops",
"stateless_random_ops",
"stateless_random_ops_v2",
"summary_ops",
"training_ops",
],
deps = [
":lib",
":protos_all_cc",
],
)
tf_gen_op_libs(
is_external = False,
op_lib_names = [
"logging_ops",
],
deps = [
":lib",
":protos_all_cc",
# TODO(b/162630222): remove this dependency.
"//tensorflow/c/kernels:histogram_summary_op_lib",
"//tensorflow/c/kernels:merge_summary_op_lib",
"//tensorflow/c/kernels:summary_op_lib",
],
)
tf_gen_op_libs(
op_lib_names = [
"string_ops",
],
deps = [
":lib_internal",
":lib_proto_parsing",
"@com_google_absl//absl/strings",
],
)
tf_gen_op_libs(
op_lib_names = [
"array_ops",
],
deps = [
":lib",
":protos_all_cc",
],
)
tf_gen_op_libs(
op_lib_names = [
"mkl_array_ops",
],
deps = [":protos_all_cc"],
)
tf_gen_op_libs(
op_lib_names = [
"audio_ops",
],
deps = [":lib"],
)
tf_gen_op_libs(
op_lib_names = ["debug_ops"],
deps = [":lib"],
)
tf_gen_op_libs(
is_external = False,
op_lib_names = [
"resource_variable_ops",
],
deps = [":lib"],
)
tf_gen_op_libs(
op_lib_names = [
"tpu_configuration_ops",
"tpu_cross_replica_ops",
"tpu_embedding_ops",
"tpu_embedding_load_retrieve_ops",
"tpu_functional_ops",
"tpu_heartbeat_ops",
"tpu_host_compute_ops",
"tpu_infeed_ops",
"tpu_outfeed_ops",
"tpu_ordinal_selector_ops",
"tpu_replication_ops",
],
deps = [
":lib",
":lib_proto_parsing",
":protos_all_cc",
"//tensorflow/core/protobuf/tpu:optimization_parameters_proto_cc",
"//tensorflow/core/protobuf/tpu:tpu_embedding_configuration_proto_cc",
"//tensorflow/core/tpu:tpu_embedding_optimization_parameters_utils",
"//tensorflow/core/tpu:tpu_embedding_output_layout_utils",
],
)
# And one for all user ops
# One target for all user ops
cc_library(
name = "user_ops_op_lib",
srcs = glob(["user_ops/**/*.cc"]),
@ -712,214 +558,29 @@ cc_library(
alwayslink = 1,
)
cc_library(
name = "word2vec_ops",
srcs = ["ops/word2vec_ops.cc"],
linkstatic = 1,
visibility = ["//tensorflow:internal"],
deps = [":framework"],
alwayslink = 1,
)
cc_library(
name = "cudnn_rnn_ops",
srcs = [
"ops/cudnn_rnn_ops.cc",
],
linkstatic = 1,
visibility = ["//tensorflow:internal"],
deps = [
":framework",
":lib",
":lib_internal",
"//tensorflow/core/kernels:bounds_check_lib",
"//tensorflow/core/platform:stream_executor",
],
alwayslink = 1,
)
tf_gen_op_libs(
op_lib_names = [
"cudnn_rnn_ops",
],
deps = [
":lib",
],
)
cc_library(
name = "ragged_ops",
deps = [
":ragged_array_ops_op_lib",
":ragged_conversion_ops_op_lib",
":ragged_math_ops_op_lib",
],
)
tf_gen_op_libs(
op_lib_names = [
"ragged_array_ops",
"ragged_conversion_ops",
"ragged_math_ops",
],
deps = ["//tensorflow/core/util:ragged_to_dense_util"],
)
cc_library(
name = "ops",
visibility = ["//visibility:public"],
deps = [
":array_ops_op_lib",
":audio_ops_op_lib",
":batch_ops_op_lib",
":bitwise_ops_op_lib",
":boosted_trees_ops_op_lib",
":tensor_forest_ops_op_lib",
":candidate_sampling_ops_op_lib",
":checkpoint_ops_op_lib",
":clustering_ops_op_lib",
":collective_ops_op_lib",
":control_flow_ops_op_lib",
":count_ops_op_lib",
":ctc_ops_op_lib",
":cudnn_rnn_ops_op_lib",
":data_flow_ops_op_lib",
":dataset_ops_op_lib",
":debug_ops_op_lib",
":decode_proto_ops_op_lib",
":encode_proto_ops_op_lib",
":experimental_dataset_ops_op_lib",
":function_ops_op_lib",
":functional_ops_op_lib",
":image_ops_op_lib",
":io_ops_op_lib",
":linalg_ops_op_lib",
":list_ops_op_lib",
":map_ops_op_lib",
":logging_ops_op_lib",
":lookup_ops_op_lib",
":manip_ops_op_lib",
":math_ops_op_lib",
":nccl_ops_op_lib",
":nn_ops_op_lib",
":no_op_op_lib",
":parsing_ops_op_lib",
":ragged_ops",
":random_ops_op_lib",
":rnn_ops_op_lib",
":special_math_ops_op_lib",
":stateful_random_ops_op_lib",
":remote_fused_graph_ops_op_lib",
":resource_variable_ops_op_lib",
":rpc_ops_op_lib",
":scoped_allocator_ops_op_lib",
":script_ops_op_lib",
":sdca_ops_op_lib",
":sendrecv_ops_op_lib",
":set_ops_op_lib",
":sparse_csr_matrix_ops_op_lib",
":sparse_ops_op_lib",
":summary_ops_op_lib",
":spectral_ops_op_lib",
":state_ops_op_lib",
":stateless_random_ops_op_lib",
":stateless_random_ops_v2_op_lib",
":string_ops_op_lib",
":training_ops_op_lib",
":user_ops_op_lib",
":word2vec_ops",
"//tensorflow/c/kernels:bitcast_op_lib",
"//tensorflow/c/kernels:histogram_summary_op_lib",
"//tensorflow/c/kernels:merge_summary_op_lib",
"//tensorflow/c/kernels:summary_op_lib",
"//tensorflow/core/ops:ops",
] + if_chromiumos(
[],
# Non-tpu platforms don't need tpu dependency.
[
":tpu_configuration_ops_op_lib",
":tpu_cross_replica_ops_op_lib",
":tpu_embedding_ops_op_lib",
":tpu_embedding_load_retrieve_ops_op_lib",
":tpu_functional_ops_op_lib",
":tpu_heartbeat_ops_op_lib",
":tpu_host_compute_ops_op_lib",
":tpu_infeed_ops_op_lib",
":tpu_outfeed_ops_op_lib",
":tpu_ordinal_selector_ops_op_lib",
":tpu_replication_ops_op_lib",
"//tensorflow/core/tpu/ops",
],
) + if_mkl([
":mkl_array_ops_op_lib",
":mkl_nn_ops_op_lib",
]) + if_tensorrt([
) + if_tensorrt([
"//tensorflow/compiler/tf2tensorrt:trt_engine_resource_ops_op_lib",
"//tensorflow/compiler/tf2tensorrt:trt_op_libs",
]) + if_libtpu(
if_false = ["//tensorflow/compiler/mlir/tensorflow:mlir_passthrough_op"],
if_true = [],
),
alwayslink = 1,
)
cc_library(
name = "array_grad",
srcs = ["ops/array_grad.cc"],
linkstatic = 1, # Needed since alwayslink is broken in bazel b/27630669
visibility = ["//visibility:public"],
deps = [
":array_ops_op_lib",
":framework",
":lib",
"//tensorflow/c/kernels:bitcast_op_lib",
],
alwayslink = 1,
)
cc_library(
name = "functional_grad",
srcs = ["ops/functional_grad.cc"],
linkstatic = 1, # Needed since alwayslink is broken in bazel b/27630669
visibility = ["//visibility:public"],
deps = [
":framework",
":functional_ops_op_lib",
":lib",
],
alwayslink = 1,
)
cc_library(
name = "math_grad",
srcs = [
"ops/math_grad.cc",
"ops/random_grad.cc",
"ops/stateless_random_grad.cc",
],
linkstatic = 1, # Needed since alwayslink is broken in bazel b/27630669
visibility = ["//visibility:public"],
deps = [
":framework",
":lib",
":math_ops_op_lib",
":protos_all_cc",
],
alwayslink = 1,
)
cc_library(
name = "nn_grad",
srcs = ["ops/nn_grad.cc"],
linkstatic = 1, # Needed since alwayslink is broken in bazel b/27630669
visibility = ["//visibility:public"],
deps = [
":framework",
":lib",
":nn_ops_op_lib",
] + if_mkl([
":mkl_nn_ops_op_lib",
]),
alwayslink = 1,
)
alias(
@ -1276,6 +937,99 @@ filegroup(
visibility = ["//visibility:public"],
)
# All the aliases for stuff under ops/
# Once the dependencies move to the real targets, remove the aliases here!
[
alias(
name = "%s" % (name,),
actual = "//tensorflow/core/ops:%s" % (name,),
visibility = ["//visibility:public"],
)
for name in [
"array_grad",
"array_ops_op_lib",
"audio_ops_op_lib",
"batch_ops_op_lib",
"bitwise_ops_op_lib",
"boosted_trees_ops_op_lib",
"candidate_sampling_ops_op_lib",
"checkpoint_ops_op_lib",
"clustering_ops_op_lib",
"collective_ops_op_lib",
"control_flow_ops_op_lib",
"count_ops_op_lib",
"ctc_ops_op_lib",
"cudnn_rnn_ops_op_lib",
"data_flow_ops_op_lib",
"dataset_ops_op_lib",
"debug_ops_op_lib",
"decode_proto_ops_op_lib",
"encode_proto_ops_op_lib",
"experimental_dataset_ops_op_lib",
"function_ops_op_lib",
"functional_grad",
"functional_ops_op_lib",
"image_ops_op_lib",
"io_ops_op_lib",
"linalg_ops_op_lib",
"list_ops_op_lib",
"logging_ops_op_lib",
"lookup_ops_op_lib",
"manip_ops_op_lib",
"map_ops_op_lib",
"math_grad",
"math_ops_op_lib",
"mkl_array_ops_op_lib",
"mkl_nn_ops_op_lib",
"nccl_ops_op_lib",
"nn_grad",
"nn_ops_op_lib",
"no_op_op_lib",
"parsing_ops_op_lib",
"portable_op_registrations_and_gradients",
"ragged_array_ops_op_lib",
"ragged_conversion_ops_op_lib",
"ragged_math_ops_op_lib",
"ragged_ops",
"random_grad_op_lib",
"random_ops_op_lib",
"remote_fused_graph_ops_op_lib",
"resource_variable_ops_op_lib",
"rnn_ops_op_lib",
"rpc_ops_op_lib",
"scoped_allocator_ops_op_lib",
"script_ops_op_lib",
"sdca_ops_op_lib",
"sendrecv_ops_op_lib",
"set_ops_op_lib",
"sparse_csr_matrix_ops_op_lib",
"sparse_ops_op_lib",
"special_math_ops_op_lib",
"spectral_ops_op_lib",
"state_ops_op_lib",
"stateful_random_ops_op_lib",
"stateless_random_ops_op_lib",
"stateless_random_ops_v2_op_lib",
"string_ops_op_lib",
"summary_ops_op_lib",
"tensor_forest_ops_op_lib",
"tpu_configuration_ops_op_lib",
"tpu_cross_replica_ops_op_lib",
"tpu_embedding_ops_op_lib",
"tpu_embedding_load_retrieve_ops_op_lib",
"tpu_functional_ops_op_lib",
"tpu_heartbeat_ops_op_lib",
"tpu_host_compute_ops_op_lib",
"tpu_infeed_ops_op_lib",
"tpu_outfeed_ops_op_lib",
"tpu_ordinal_selector_ops_op_lib",
"tpu_replication_ops_op_lib",
"training_ops_op_lib",
"word2vec_ops",
]
]
# Native library support for mobile applications. Does not contain
# operators, use :portable_tensorflow_lib if you want full operator
# support.
@ -1342,24 +1096,6 @@ cc_library(
alwayslink = 1,
)
filegroup(
name = "portable_op_registrations_and_gradients",
srcs = ["//tensorflow/c/kernels:android_all_ops"] + glob(
[
"ops/**/*.cc",
"ops/**/*.h",
],
exclude = [
"**/*test.cc",
"**/*testutil*",
"**/*testlib*",
"**/*main.cc",
"**/tpu_*",
],
),
visibility = ["//visibility:public"],
)
# This is like android_test_srcs, minus the things that are already in mobile_srcs.
filegroup(
name = "android_test_srcs_no_core",
@ -2357,22 +2093,6 @@ tf_cc_tests(
],
)
tf_cc_test(
name = "cudnn_rnn_ops_test_cc",
size = "small",
srcs = [
"ops/cudnn_rnn_ops_test.cc",
],
deps = [
":core",
":framework",
":lib",
":test",
":test_main",
":testlib",
],
)
tf_cc_test_mkl(
name = "mkl_related_tests",
size = "small",
@ -2541,132 +2261,6 @@ tf_cc_test(
],
)
tf_cc_test(
name = "ops_array_grad_test",
size = "small",
srcs = ["ops/array_grad_test.cc"],
linkstatic = tf_kernel_tests_linkstatic(),
deps = [
":core",
":core_cpu",
":core_cpu_internal",
":direct_session_internal",
":framework",
":framework_internal",
":lib",
":lib_internal",
":ops",
":protos_all_cc",
":test",
":test_main",
":testlib",
"//tensorflow/cc:cc_ops",
"//tensorflow/core/kernels:array",
"//tensorflow/core/kernels:cwise_op",
"//tensorflow/core/kernels:function_ops",
"//tensorflow/core/kernels:math",
"//third_party/eigen3",
],
)
tf_cc_test(
name = "ops_math_grad_test",
size = "small",
srcs = ["ops/math_grad_test.cc"],
linkstatic = tf_kernel_tests_linkstatic(),
tags = ["no_gpu"],
deps = [
":core",
":core_cpu",
":core_cpu_internal",
":direct_session_internal",
":framework",
":framework_internal",
":lib",
":lib_internal",
":ops",
":protos_all_cc",
":test",
":test_main",
":testlib",
"//tensorflow/cc:cc_ops",
"//tensorflow/core/kernels:array",
"//tensorflow/core/kernels:data_flow",
"//tensorflow/core/kernels:function_ops",
"//tensorflow/core/kernels:math",
"//third_party/eigen3",
],
)
tf_cc_test(
name = "ops_remote_fused_graph_ops_test",
size = "small",
srcs = ["ops/remote_fused_graph_ops_test.cc"],
linkstatic = tf_kernel_tests_linkstatic(),
deps = [
":core",
":core_cpu",
":core_cpu_internal",
":framework",
":framework_internal",
":lib",
":lib_internal",
":ops",
":protos_all_cc",
":test",
":test_main",
":testlib",
"//tensorflow/core/kernels:remote_fused_graph_ops",
],
)
tf_cc_test(
name = "ops_tests",
size = "small",
srcs = [
"ops/array_ops_test.cc",
"ops/candidate_sampling_ops_test.cc",
"ops/control_flow_ops_test.cc",
"ops/ctc_ops_test.cc",
"ops/data_flow_ops_test.cc",
"ops/functional_ops_test.cc",
"ops/image_ops_test.cc",
"ops/io_ops_test.cc",
"ops/linalg_ops_test.cc",
"ops/lookup_ops_test.cc",
"ops/math_ops_test.cc",
"ops/nn_ops_test.cc",
"ops/parsing_ops_test.cc",
"ops/random_ops_test.cc",
"ops/rnn_ops_test.cc",
"ops/set_ops_test.cc",
"ops/shape_function_test.cc",
"ops/sparse_csr_matrix_ops_test.cc",
"ops/sparse_ops_test.cc",
"ops/spectral_ops_test.cc",
"ops/state_ops_test.cc",
"ops/string_ops_test.cc",
"ops/training_ops_test.cc",
],
linkstatic = tf_kernel_tests_linkstatic(),
deps = [
":core",
":core_cpu",
":core_cpu_internal",
":framework",
":framework_internal",
":lib",
":lib_internal",
":ops",
":protos_all_cc",
":test",
":test_main",
":testlib",
"//tensorflow/cc:cc_ops",
"//third_party/eigen3",
],
)
# Test data
filegroup(
name = "image_testdata",

539
tensorflow/core/ops/BUILD Normal file
View File

@ -0,0 +1,539 @@
# Description:
# Tensorflow default op definitions.
load(
"//tensorflow:tensorflow.bzl",
"if_chromiumos",
"tf_cc_test",
)
# buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "tf_gen_op_libs")
# buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "filegroup")
# For platform specific build config
load(
"//tensorflow/core/platform:build_config.bzl",
"tf_kernel_tests_linkstatic",
)
load(
"//tensorflow/core/platform:rules_cc.bzl",
"cc_library",
)
load(
"//third_party/mkl:build_defs.bzl",
"if_mkl",
)
# A lot of packages try to minimize binary size by depending on individual ops,\
# so they need access here.
package(
default_visibility = [
"//visibility:public",
],
features = ["-parse_headers"],
licenses = ["notice"], # Apache 2.0
)
# Export the BUILD file so automated tooling can check licenses
exports_files([
"BUILD",
"ops.pbtxt",
])
# Generates library per group of ops.
tf_gen_op_libs(
is_external = False,
op_lib_names = [
"batch_ops",
"bitwise_ops",
"boosted_trees_ops",
"tensor_forest_ops",
"candidate_sampling_ops",
"checkpoint_ops",
"clustering_ops",
"collective_ops",
"control_flow_ops",
"count_ops",
"ctc_ops",
"data_flow_ops",
"dataset_ops",
"decode_proto_ops",
"encode_proto_ops",
"experimental_dataset_ops",
"function_ops",
"functional_ops",
"image_ops",
"io_ops",
"linalg_ops",
"list_ops",
"map_ops",
"lookup_ops",
"manip_ops",
"math_ops",
"mkl_nn_ops",
"nccl_ops",
"nn_ops",
"no_op",
"parsing_ops",
"random_grad",
"random_ops",
"special_math_ops",
"stateful_random_ops",
"remote_fused_graph_ops",
"rnn_ops",
"rpc_ops",
"scoped_allocator_ops",
"sdca_ops",
"set_ops",
"script_ops",
"sendrecv_ops",
"sparse_csr_matrix_ops",
"sparse_ops",
"spectral_ops",
"state_ops",
"stateless_random_ops",
"stateless_random_ops_v2",
"summary_ops",
"training_ops",
],
sub_directory = "",
deps = [
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
],
)
tf_gen_op_libs(
is_external = False,
op_lib_names = [
"logging_ops",
],
sub_directory = "",
deps = [
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
# TODO(b/162630222): remove this dependency.
"//tensorflow/c/kernels:histogram_summary_op_lib",
"//tensorflow/c/kernels:merge_summary_op_lib",
"//tensorflow/c/kernels:summary_op_lib",
],
)
tf_gen_op_libs(
op_lib_names = [
"string_ops",
],
sub_directory = "",
deps = [
"//tensorflow/core:lib_internal",
"//tensorflow/core:lib_proto_parsing",
"@com_google_absl//absl/strings",
],
)
tf_gen_op_libs(
op_lib_names = [
"array_ops",
],
sub_directory = "",
deps = [
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
],
)
tf_gen_op_libs(
op_lib_names = [
"mkl_array_ops",
],
sub_directory = "",
deps = ["//tensorflow/core:protos_all_cc"],
)
tf_gen_op_libs(
op_lib_names = [
"audio_ops",
],
sub_directory = "",
deps = ["//tensorflow/core:lib"],
)
tf_gen_op_libs(
op_lib_names = ["debug_ops"],
sub_directory = "",
deps = ["//tensorflow/core:lib"],
)
tf_gen_op_libs(
is_external = False,
op_lib_names = [
"resource_variable_ops",
],
sub_directory = "",
deps = ["//tensorflow/core:lib"],
)
tf_gen_op_libs(
op_lib_names = [
"tpu_configuration_ops",
"tpu_cross_replica_ops",
"tpu_embedding_ops",
"tpu_embedding_load_retrieve_ops",
"tpu_functional_ops",
"tpu_heartbeat_ops",
"tpu_host_compute_ops",
"tpu_infeed_ops",
"tpu_outfeed_ops",
"tpu_ordinal_selector_ops",
"tpu_replication_ops",
],
sub_directory = "",
deps = [
"//tensorflow/core:lib",
"//tensorflow/core:lib_proto_parsing",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core/protobuf/tpu:optimization_parameters_proto_cc",
"//tensorflow/core/protobuf/tpu:tpu_embedding_configuration_proto_cc",
"//tensorflow/core/tpu:tpu_embedding_optimization_parameters_utils",
"//tensorflow/core/tpu:tpu_embedding_output_layout_utils",
],
)
cc_library(
name = "word2vec_ops",
srcs = ["word2vec_ops.cc"],
linkstatic = 1,
deps = ["//tensorflow/core:framework"],
alwayslink = 1,
)
tf_gen_op_libs(
op_lib_names = [
"cudnn_rnn_ops",
],
sub_directory = "",
deps = [
"//tensorflow/core:lib",
],
)
cc_library(
name = "ragged_ops",
deps = [
"//tensorflow/core:ragged_array_ops_op_lib",
"//tensorflow/core:ragged_conversion_ops_op_lib",
"//tensorflow/core:ragged_math_ops_op_lib",
],
)
tf_gen_op_libs(
op_lib_names = [
"ragged_array_ops",
"ragged_conversion_ops",
"ragged_math_ops",
],
sub_directory = "",
deps = ["//tensorflow/core/util:ragged_to_dense_util"],
)
cc_library(
name = "ops",
deps = [
":array_ops_op_lib",
":audio_ops_op_lib",
":batch_ops_op_lib",
":bitwise_ops_op_lib",
":boosted_trees_ops_op_lib",
":tensor_forest_ops_op_lib",
":candidate_sampling_ops_op_lib",
":checkpoint_ops_op_lib",
":clustering_ops_op_lib",
":collective_ops_op_lib",
":control_flow_ops_op_lib",
":count_ops_op_lib",
":ctc_ops_op_lib",
":cudnn_rnn_ops_op_lib",
":data_flow_ops_op_lib",
":dataset_ops_op_lib",
":debug_ops_op_lib",
":decode_proto_ops_op_lib",
":encode_proto_ops_op_lib",
":experimental_dataset_ops_op_lib",
":function_ops_op_lib",
":functional_ops_op_lib",
":image_ops_op_lib",
":io_ops_op_lib",
":linalg_ops_op_lib",
":list_ops_op_lib",
":map_ops_op_lib",
":logging_ops_op_lib",
":lookup_ops_op_lib",
":manip_ops_op_lib",
":math_ops_op_lib",
":nccl_ops_op_lib",
":nn_ops_op_lib",
":no_op_op_lib",
":parsing_ops_op_lib",
":ragged_ops",
":random_ops_op_lib",
":rnn_ops_op_lib",
":special_math_ops_op_lib",
":stateful_random_ops_op_lib",
":remote_fused_graph_ops_op_lib",
":resource_variable_ops_op_lib",
":rpc_ops_op_lib",
":scoped_allocator_ops_op_lib",
":script_ops_op_lib",
":sdca_ops_op_lib",
":sendrecv_ops_op_lib",
":set_ops_op_lib",
":sparse_csr_matrix_ops_op_lib",
":sparse_ops_op_lib",
":summary_ops_op_lib",
":spectral_ops_op_lib",
":state_ops_op_lib",
":stateless_random_ops_op_lib",
":stateless_random_ops_v2_op_lib",
":string_ops_op_lib",
":training_ops_op_lib",
":word2vec_ops",
] + if_chromiumos(
[],
# Non-tpu platforms don't need tpu dependency.
[
":tpu_configuration_ops_op_lib",
":tpu_cross_replica_ops_op_lib",
":tpu_embedding_ops_op_lib",
":tpu_embedding_load_retrieve_ops_op_lib",
":tpu_functional_ops_op_lib",
":tpu_heartbeat_ops_op_lib",
":tpu_host_compute_ops_op_lib",
":tpu_infeed_ops_op_lib",
":tpu_outfeed_ops_op_lib",
":tpu_ordinal_selector_ops_op_lib",
":tpu_replication_ops_op_lib",
],
) + if_mkl([
":mkl_array_ops_op_lib",
":mkl_nn_ops_op_lib",
]),
alwayslink = 1,
)
cc_library(
name = "array_grad",
srcs = ["array_grad.cc"],
linkstatic = 1, # Needed since alwayslink is broken in bazel b/27630669
deps = [
":array_ops_op_lib",
"//tensorflow/c/kernels:bitcast_op_lib",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
],
alwayslink = 1,
)
cc_library(
name = "functional_grad",
srcs = ["functional_grad.cc"],
linkstatic = 1, # Needed since alwayslink is broken in bazel b/27630669
deps = [
":functional_ops_op_lib",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
],
alwayslink = 1,
)
cc_library(
name = "math_grad",
srcs = [
"math_grad.cc",
"random_grad.cc",
"stateless_random_grad.cc",
],
linkstatic = 1, # Needed since alwayslink is broken in bazel b/27630669
deps = [
":math_ops_op_lib",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
],
alwayslink = 1,
)
cc_library(
name = "nn_grad",
srcs = ["nn_grad.cc"],
linkstatic = 1, # Needed since alwayslink is broken in bazel b/27630669
deps = [
"//tensorflow/core:framework",
"//tensorflow/core:lib",
":nn_ops_op_lib",
] + if_mkl([
":mkl_nn_ops_op_lib",
]),
alwayslink = 1,
)
filegroup(
name = "portable_op_registrations_and_gradients",
srcs = ["//tensorflow/c/kernels:android_all_ops"] + glob(
[
"**/*.cc",
"**/*.h",
],
exclude = [
"**/*test.cc",
"**/*testutil*",
"**/*testlib*",
"**/*main.cc",
"**/tpu_*",
],
),
)
tf_cc_test(
name = "cudnn_rnn_ops_test_cc",
size = "small",
srcs = [
"cudnn_rnn_ops_test.cc",
],
deps = [
"//tensorflow/core",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//tensorflow/core:testlib",
],
)
tf_cc_test(
name = "ops_array_grad_test",
size = "small",
srcs = ["array_grad_test.cc"],
linkstatic = tf_kernel_tests_linkstatic(),
deps = [
":ops",
"//tensorflow/cc:cc_ops",
"//tensorflow/core",
"//tensorflow/core:core_cpu",
"//tensorflow/core:core_cpu_internal",
"//tensorflow/core:direct_session_internal",
"//tensorflow/core:framework",
"//tensorflow/core:framework_internal",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//tensorflow/core:testlib",
"//tensorflow/core/kernels:array",
"//tensorflow/core/kernels:cwise_op",
"//tensorflow/core/kernels:function_ops",
"//tensorflow/core/kernels:math",
"//third_party/eigen3",
],
)
tf_cc_test(
name = "ops_math_grad_test",
size = "small",
srcs = ["math_grad_test.cc"],
linkstatic = tf_kernel_tests_linkstatic(),
tags = ["no_gpu"],
deps = [
":ops",
"//tensorflow/cc:cc_ops",
"//tensorflow/core",
"//tensorflow/core:core_cpu",
"//tensorflow/core:core_cpu_internal",
"//tensorflow/core:direct_session_internal",
"//tensorflow/core:framework",
"//tensorflow/core:framework_internal",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//tensorflow/core:testlib",
"//tensorflow/core/kernels:array",
"//tensorflow/core/kernels:data_flow",
"//tensorflow/core/kernels:function_ops",
"//tensorflow/core/kernels:math",
"//third_party/eigen3",
],
)
tf_cc_test(
name = "ops_remote_fused_graph_ops_test",
size = "small",
srcs = ["remote_fused_graph_ops_test.cc"],
linkstatic = tf_kernel_tests_linkstatic(),
deps = [
":ops",
"//tensorflow/core",
"//tensorflow/core:core_cpu",
"//tensorflow/core:core_cpu_internal",
"//tensorflow/core:framework",
"//tensorflow/core:framework_internal",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//tensorflow/core:testlib",
"//tensorflow/core/kernels:remote_fused_graph_ops",
],
)
tf_cc_test(
name = "ops_tests",
size = "small",
srcs = [
"array_ops_test.cc",
"candidate_sampling_ops_test.cc",
"control_flow_ops_test.cc",
"ctc_ops_test.cc",
"data_flow_ops_test.cc",
"functional_ops_test.cc",
"image_ops_test.cc",
"io_ops_test.cc",
"linalg_ops_test.cc",
"lookup_ops_test.cc",
"math_ops_test.cc",
"nn_ops_test.cc",
"parsing_ops_test.cc",
"random_ops_test.cc",
"rnn_ops_test.cc",
"set_ops_test.cc",
"shape_function_test.cc",
"sparse_csr_matrix_ops_test.cc",
"sparse_ops_test.cc",
"spectral_ops_test.cc",
"state_ops_test.cc",
"string_ops_test.cc",
"training_ops_test.cc",
],
linkstatic = tf_kernel_tests_linkstatic(),
deps = [
":ops",
"//tensorflow/cc:cc_ops",
"//tensorflow/core",
"//tensorflow/core:core_cpu",
"//tensorflow/core:core_cpu_internal",
"//tensorflow/core:framework",
"//tensorflow/core:framework_internal",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//tensorflow/core:testlib",
"//third_party/eigen3",
],
)

View File

@ -20,11 +20,11 @@ cc_library(
hdrs = ["op_compatibility_lib.h"],
visibility = ["//visibility:public"],
deps = [
"//tensorflow/core:debug_ops_op_lib",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:ops",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core/ops:debug_ops_op_lib",
],
)
@ -35,7 +35,7 @@ tf_cc_test(
"backwards_compatibility_test.cc",
],
data = [
"//tensorflow/core:ops/ops.pbtxt",
"//tensorflow/core/ops:ops.pbtxt",
"//tensorflow/core/ops/compat/ops_history_v1:ops_history_v1_srcs",
"//tensorflow/core/ops/compat/ops_history_v2:ops_history_v2_srcs",
] + glob([