blob: 2499f605ec564827bf4ca6e380c015771fc41ab5 [file] [log] [blame]
load("//tensorflow:strict.default.bzl", "py_strict_binary", "py_strict_library", "py_strict_test")
load("//tensorflow:tensorflow.bzl", "check_deps")
load("//tensorflow:tensorflow.default.bzl", "cuda_py_strict_test", "tf_py_strict_test", "tf_python_pybind_extension")
load("//tensorflow/python/tpu:tpu.bzl", "tpu_py_strict_test")
load(
"//tensorflow/tools/test:performance.bzl",
"tf_py_logged_benchmark",
)
load("//tensorflow/compiler/tests:build_defs.bzl", "tf_xla_py_test")
load(
"//tensorflow/core/platform:build_config.bzl",
"tf_additional_rpc_deps",
)
package(
# copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
licenses = ["notice"],
)
cc_library(
name = "pywrap_tfe_lib",
srcs = [
"pywrap_gradient_exclusions.cc",
"pywrap_tensor.cc",
"pywrap_tensor_conversion.cc",
"pywrap_tfe_src.cc",
],
hdrs = [
"pywrap_gradient_exclusions.h",
"pywrap_tensor.h",
"pywrap_tensor_conversion.h",
"pywrap_tfe.h",
],
copts = ["-fexceptions"],
features = [
"-use_header_modules", # Required for pybind11
],
visibility = ["//tensorflow:internal"],
deps = [
"//tensorflow/c:c_api",
"//tensorflow/c:c_api_internal",
"//tensorflow/c:safe_ptr",
"//tensorflow/c/eager:c_api",
"//tensorflow/c/eager:c_api_experimental",
"//tensorflow/c/eager:c_api_internal",
"//tensorflow/c/eager:dlpack",
"//tensorflow/c/eager:tape",
"//tensorflow/c/eager:tfe_context_internal",
"//tensorflow/c/eager:tfe_op_internal",
"//tensorflow/c/eager:tfe_tensorhandle_internal",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core/common_runtime/eager:tensor_handle",
"//tensorflow/core/platform:logging",
"//tensorflow/core/platform:types",
"//tensorflow/core/profiler/lib:traceme",
"//tensorflow/core/util:managed_stack_trace",
"//tensorflow/python:ndarray_tensor",
"//tensorflow/python:ndarray_tensor_bridge",
"//tensorflow/python:py_exception_registry",
"//tensorflow/python:pybind11_status",
"//tensorflow/python/lib/core:py_seq_tensor",
"//tensorflow/python/lib/core:py_util",
"//tensorflow/python/lib/core:safe_pyobject_ptr",
"//tensorflow/python/util:cpp_python_util",
"//tensorflow/python/util:stack_trace",
"//tensorflow/tsl/python/lib/core:numpy",
"//third_party/py/numpy:headers",
"//third_party/python_runtime:headers",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/debugging:leak_check",
"@com_google_absl//absl/hash",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:optional",
"@com_google_absl//absl/types:variant",
"@pybind11",
],
)
tf_python_pybind_extension(
name = "pywrap_tensor_test_util",
testonly = True,
srcs = ["pywrap_tensor_test_util.cc"],
deps = [
":pywrap_tfe_lib",
"//tensorflow/c:tf_status_helper",
"//tensorflow/c/eager:c_api_test_util",
"//tensorflow/python:pybind11_lib",
"@pybind11",
],
)
cuda_py_strict_test(
name = "pywrap_tensor_test",
size = "small",
srcs = ["pywrap_tensor_test.py"],
python_version = "PY3",
tags = [
"no_oss", # TODO(b/168051787): Enable.
"no_pip", # TODO(b/168051787): Enable.
],
deps = [
":pywrap_tensor_test_util",
":test",
"//third_party/py/numpy",
],
)
filegroup(
name = "pywrap_required_hdrs",
srcs = [
"pywrap_tensor.h",
"pywrap_tensor_conversion.h",
"pywrap_tfe.h",
],
visibility = [
"//tensorflow/core:__pkg__",
"//tensorflow/python:__subpackages__",
],
)
# Transitive dependencies of this target will be included in the pip package.
py_strict_library(
name = "eager_pip",
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
":backprop",
":benchmarks_test_base",
":cancellation",
":context",
":core",
":def_function",
":execute",
":forwardprop",
":forwardprop_util",
":function",
":graph_only_ops",
":monitoring",
":profiler",
":profiler_client",
":tape",
":test",
":wrap_function",
"//tensorflow/python:pywrap_tensorflow",
"//tensorflow/python/dlpack",
"//tensorflow/python/eager/memory_tests:memory_test_util",
],
)
py_strict_library(
name = "core",
srcs = ["core.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
"//tensorflow/python:errors",
"//tensorflow/python:pywrap_tfe",
"//tensorflow/python/platform:tf_logging",
],
)
py_strict_library(
name = "cancellation",
srcs = ["cancellation.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
"//tensorflow/python:pywrap_tfe",
],
)
cuda_py_strict_test(
name = "cancellation_test",
size = "small",
srcs = ["cancellation_test.py"],
python_version = "PY3",
deps = [
":cancellation",
"//tensorflow/python/platform:client_testlib",
],
)
py_strict_library(
name = "executor",
srcs = ["executor.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
"//tensorflow/python:pywrap_tfe",
],
)
py_strict_library(
name = "context",
srcs = ["context.py"],
srcs_version = "PY3",
visibility = [
"//tensorflow:internal",
"//third_party/py/jax_tpu_embedding:__subpackages__",
],
deps = [
":cancellation",
":execute",
":executor",
":monitoring",
"//tensorflow/core:protos_all_py",
"//tensorflow/python:c_api_util",
"//tensorflow/python:device",
"//tensorflow/python:pywrap_tf_session",
"//tensorflow/python:pywrap_tfe",
"//tensorflow/python:tf2",
"//tensorflow/python:tfrt_utils",
"//tensorflow/python/util:compat",
"//tensorflow/python/util:deprecation",
"//tensorflow/python/util:function_utils",
"//tensorflow/python/util:is_in_graph_mode",
"//tensorflow/python/util:tf_decorator",
"//tensorflow/python/util:tf_export",
"//third_party/py/numpy",
"@absl_py//absl/logging",
],
)
tf_python_pybind_extension(
name = "custom_device_testutil",
testonly = True,
srcs = ["custom_device_testutil.cc"],
deps = [
"//tensorflow/c:c_api",
"//tensorflow/c:safe_ptr",
"//tensorflow/c:tf_status_helper",
"//tensorflow/c/eager:c_api",
"//tensorflow/c/eager:c_api_experimental",
"//tensorflow/c/eager:custom_device_testutil",
"//tensorflow/python:pybind11_lib",
"//tensorflow/python/lib/core:pybind11_status",
"//tensorflow/python/lib/core:safe_pyobject_ptr",
"//tensorflow/python/util:cpp_python_util",
"//third_party/python_runtime:headers",
"@pybind11",
],
)
py_strict_test(
name = "custom_device_test",
size = "small",
srcs = ["custom_device_test.py"],
python_version = "PY3",
# Note that this currently only works with --config=monolithic, since it
# requires the C API which runs static initializers again.
#
# TODO(allenl): Figure out a way to allow extensions to register custom
# devices which works with dynamic linking.
tags = [
"no_oss",
"no_pip",
],
deps = [
":context",
":custom_device_testutil",
"//tensorflow/python/framework:constant_op",
"//tensorflow/python/framework:errors",
"//tensorflow/python/framework:ops",
"//tensorflow/python/platform:client_testlib",
],
)
cuda_py_strict_test(
name = "context_test",
size = "small",
srcs = ["context_test.py"],
python_version = "PY3",
xla_enabled = True,
deps = [
":context",
":def_function",
"//tensorflow/compiler/xla/service:hlo_proto_py",
"//tensorflow/python:array_ops",
"//tensorflow/python/framework:constant_op",
"//tensorflow/python/framework:errors",
"//tensorflow/python/framework:ops",
"//tensorflow/python/framework:test_lib",
"//tensorflow/python/platform:client_testlib",
"@absl_py//absl/testing:parameterized",
],
)
py_strict_library(
name = "monitoring",
srcs = ["monitoring.py"],
srcs_version = "PY3",
visibility = ["//visibility:public"],
deps = [
"//tensorflow/core:protos_all_py",
"//tensorflow/python:c_api_util",
"//tensorflow/python:pywrap_tf_session",
"//tensorflow/python:pywrap_tfe",
"//tensorflow/python/util:compat",
"//tensorflow/python/util:tf_export",
],
)
cuda_py_strict_test(
name = "monitoring_test",
srcs = ["monitoring_test.py"],
python_version = "PY3",
deps = [
":monitoring",
":test",
"//tensorflow/python/framework:errors",
"//tensorflow/python/framework:test_lib",
],
)
py_strict_library(
name = "profiler",
srcs = ["profiler.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
":context",
"//tensorflow/python/client:_pywrap_events_writer",
"//tensorflow/python/framework:errors",
"//tensorflow/python/platform:gfile",
"//tensorflow/python/platform:tf_logging",
"//tensorflow/python/profiler/internal:_pywrap_profiler",
"//tensorflow/python/util:compat",
"//tensorflow/python/util:deprecation",
],
)
cuda_py_strict_test(
name = "profiler_test",
srcs = ["profiler_test.py"],
python_version = "PY3",
tags = [
"no_rocm",
"no_windows", # TODO(b/184424727): Re-enable this.
],
deps = [
":profiler",
":test",
"//tensorflow/python:constant_op",
"//tensorflow/python/framework:config",
"//tensorflow/python/framework:test_lib",
"//tensorflow/python/platform:gfile",
"//tensorflow/python/profiler:trace",
"//tensorflow/tsl/profiler/protobuf:trace_events_proto_py",
],
)
py_strict_library(
name = "profiler_client",
srcs = ["profiler_client.py"],
srcs_version = "PY3",
visibility = [
"//tensorflow:internal",
"//tensorflow/core/profiler:internal",
],
deps = [
"//tensorflow/python/profiler/internal:_pywrap_profiler",
"//tensorflow/python/util:deprecation",
],
)
py_strict_test(
name = "profiler_client_test",
srcs = ["profiler_client_test.py"],
python_version = "PY3",
srcs_version = "PY3",
tags = [
"no_pip",
"no_windows",
],
deps = [
":profiler_client",
":test",
"//tensorflow/python/framework:errors",
"//tensorflow/python/framework:test_lib",
],
)
cuda_py_strict_test(
name = "small_constants_optimizer_test",
size = "medium",
srcs = ["small_constants_optimizer_test.py"],
python_version = "PY3",
deps = [
":context",
"//tensorflow/python:client_testlib",
"//tensorflow/python:constant_op",
"//tensorflow/python:framework_ops",
"//tensorflow/python/eager/polymorphic_function",
"//tensorflow/python/framework:errors",
"//tensorflow/python/framework:test_lib",
],
)
py_strict_test(
name = "summary_optimizer_test",
srcs = ["summary_optimizer_test.py"],
python_version = "PY3",
srcs_version = "PY3",
tags = [
"no_oss",
"no_pip",
], # TODO(b/219089812)
deps = [
"//tensorflow/core:protos_all_py",
"//tensorflow/core/function/runtime_client:runtime_client_py",
"//tensorflow/python:client_testlib",
"//tensorflow/python/data/ops:readers",
"//tensorflow/python/eager/polymorphic_function",
"//tensorflow/python/framework:constant_op",
"//tensorflow/python/framework:dtypes",
"//tensorflow/python/framework:test_lib",
"//tensorflow/python/ops:math_ops",
"//tensorflow/python/ops:summary_ops_v2",
"//tensorflow/python/ops:variables",
"//tensorflow/python/ops:while_loop",
"//tensorflow/python/platform:gfile",
"@absl_py//absl/flags",
],
)
py_strict_library(
name = "tape",
srcs = ["tape.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
"//tensorflow/python:pywrap_tfe",
],
)
py_strict_library(
name = "record",
srcs = ["record.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = ["//tensorflow/python:pywrap_tfe"],
)
cuda_py_strict_test(
name = "tensor_test",
srcs = ["tensor_test.py"],
python_version = "PY3",
deps = [
":context",
":core",
":test",
"//tensorflow/python:array_ops",
"//tensorflow/python:errors",
"//tensorflow/python:framework_ops",
"//tensorflow/python:io_ops",
"//tensorflow/python:list_ops",
"//tensorflow/python:pywrap_tfe",
"//tensorflow/python:resource_variable_ops",
"//tensorflow/python:variables",
"//tensorflow/python/framework:constant_op",
"//tensorflow/python/framework:dtypes",
"//tensorflow/python/framework:test_lib",
],
)
cuda_py_strict_test(
name = "backprop_test",
srcs = ["backprop_test.py"],
python_version = "PY3",
tags = [
"no_cuda_asan", # b/173825938
"no_windows", #TODO(b/139745667)
],
xla_tags = [
"no_cuda_asan", # times out
],
deps = [
":backprop",
":backprop_util",
":context",
":def_function",
":record",
":test",
"//tensorflow/python:array_ops",
"//tensorflow/python:array_ops_stack",
"//tensorflow/python:cond",
"//tensorflow/python:embedding_ops",
"//tensorflow/python:functional_ops",
"//tensorflow/python:gradient_checker_v2",
"//tensorflow/python:gradients",
"//tensorflow/python:layers",
"//tensorflow/python:math_ops",
"//tensorflow/python:nn",
"//tensorflow/python:nn_ops",
"//tensorflow/python:pywrap_tfe",
"//tensorflow/python:random_ops",
"//tensorflow/python:resource_variable_ops",
"//tensorflow/python:sparse_ops",
"//tensorflow/python:training",
"//tensorflow/python:variables",
"//tensorflow/python:while_loop",
"//tensorflow/python/framework:constant_op",
"//tensorflow/python/framework:dtypes",
"//tensorflow/python/framework:errors",
"//tensorflow/python/framework:memory_checker",
"//tensorflow/python/framework:ops",
"//tensorflow/python/framework:sparse_tensor",
"//tensorflow/python/framework:tensor_shape",
"//tensorflow/python/framework:tensor_util",
"//tensorflow/python/framework:test_lib",
"//tensorflow/python/ops:nn_grad",
"//third_party/py/numpy",
"@absl_py//absl/testing:parameterized",
],
)
cuda_py_strict_test(
name = "forwardprop_test",
srcs = ["forwardprop_test.py"],
python_version = "PY3",
shard_count = 5,
deps = [
":backprop",
":context",
":def_function",
":forwardprop",
":forwardprop_util",
":record",
"//tensorflow/python:array_ops",
"//tensorflow/python:array_ops_stack",
"//tensorflow/python:gradient_checker_v2",
"//tensorflow/python:gradients",
"//tensorflow/python:map_fn",
"//tensorflow/python:math_ops",
"//tensorflow/python:nn",
"//tensorflow/python:nn_ops",
"//tensorflow/python:pywrap_tfe",
"//tensorflow/python:random_ops",
"//tensorflow/python:unconnected_gradients",
"//tensorflow/python:variables",
"//tensorflow/python/distribute:mirrored_strategy",
"//tensorflow/python/framework:constant_op",
"//tensorflow/python/framework:dtypes",
"//tensorflow/python/framework:ops",
"//tensorflow/python/framework:test_lib",
"//tensorflow/python/module",
"//tensorflow/python/ops/parallel_for:control_flow_ops",
"//tensorflow/python/platform:client_testlib",
"//tensorflow/python/util:nest",
"@absl_py//absl/testing:parameterized",
],
)
cuda_py_strict_test(
name = "core_test",
size = "small",
srcs = ["core_test.py"],
python_version = "PY3",
deps = [
":context",
":core",
":def_function",
":execute",
":executor",
":test",
"//tensorflow/core:protos_all_py",
"//tensorflow/python:array_ops",
"//tensorflow/python:dtypes",
"//tensorflow/python:errors",
"//tensorflow/python:framework_ops",
"//tensorflow/python:framework_test_lib",
"//tensorflow/python:nn_ops",
"//tensorflow/python:pywrap_tfe",
"//tensorflow/python:resource_variable_ops",
"//tensorflow/python:resource_variable_ops_gen",
"//tensorflow/python:script_ops",
"//tensorflow/python:variables",
"//tensorflow/python/framework:config",
"//tensorflow/python/framework:constant_op",
"//tensorflow/python/framework:device",
"//tensorflow/python/platform:tf_logging",
"//third_party/py/numpy",
],
)
py_strict_library(
name = "test",
srcs = ["test.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
"//tensorflow/python:client_testlib",
"//tensorflow/python:framework_ops",
],
)
py_strict_library(
name = "execute",
srcs = ["execute.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
":core",
"//tensorflow/core:protos_all_py",
"//tensorflow/python:dtypes",
"//tensorflow/python:pywrap_tfe",
"//tensorflow/python:tensor_shape",
"//tensorflow/python/framework:tensor_conversion_registry",
"//tensorflow/python/types:core",
"//tensorflow/python/util:compat",
],
)
py_strict_library(
name = "graph_only_ops",
srcs = ["graph_only_ops.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
"//tensorflow/core:protos_all_py",
"//tensorflow/python:framework_ops",
"//tensorflow/python:op_callbacks",
"//tensorflow/python:tensor_shape",
],
)
cuda_py_strict_test(
name = "graph_only_ops_test",
srcs = ["graph_only_ops_test.py"],
python_version = "PY3",
deps = [
"graph_only_ops",
"//tensorflow/python:client_testlib",
"//tensorflow/python:dtypes",
"//tensorflow/python:framework_test_lib",
"//tensorflow/python:math_ops",
"//tensorflow/python/framework:ops",
"//third_party/py/numpy",
],
)
py_strict_library(
name = "framework_for_generated_wrappers",
deprecation = "Depending on this target can cause build dependency cycles. Depend on the fine-grained sub-targets instead.",
srcs_version = "PY3",
visibility = ["//visibility:public"],
deps = [
":execute",
"//tensorflow/python:dtypes",
"//tensorflow/python:framework_for_generated_wrappers",
"//tensorflow/python:tensor_shape",
],
)
py_strict_library(
name = "function",
srcs = ["function.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
"//tensorflow/python/eager/polymorphic_function:atomic_function",
"//tensorflow/python/eager/polymorphic_function:concrete_function",
"//tensorflow/python/eager/polymorphic_function:tf_method_target",
"//tensorflow/python/eager/polymorphic_function:tracing_compiler",
"//tensorflow/python/eager/polymorphic_function:transform",
],
)
py_strict_library(
name = "backprop",
srcs = ["backprop.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
":backprop_util",
":context",
":execute",
":imperative_grad",
":tape",
"//tensorflow/python:array_ops",
"//tensorflow/python:array_ops_gen",
"//tensorflow/python:check_ops",
"//tensorflow/python:constant_op",
"//tensorflow/python:control_flow_util",
"//tensorflow/python:default_gradient",
"//tensorflow/python:dtypes",
"//tensorflow/python:framework_ops",
"//tensorflow/python:math_ops_gen",
"//tensorflow/python:pywrap_tfe",
"//tensorflow/python:resource_variable_ops",
"//tensorflow/python:tensor_shape",
"//tensorflow/python:unconnected_gradients",
"//tensorflow/python/framework:composite_tensor",
"//tensorflow/python/framework:composite_tensor_gradient",
"//tensorflow/python/framework:indexed_slices",
"//tensorflow/python/framework:tensor_util",
"//tensorflow/python/framework:type_spec",
"//tensorflow/python/ops/parallel_for:control_flow_ops",
"//tensorflow/python/platform:tf_logging",
"//tensorflow/python/util:_pywrap_utils",
"//tensorflow/python/util:nest",
"//tensorflow/python/util:tf_decorator",
"//tensorflow/python/util:tf_export",
"//tensorflow/python/util:variable_utils",
],
)
py_strict_library(
name = "backprop_util",
srcs = ["backprop_util.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
"//tensorflow/core:protos_all_py",
"//tensorflow/core/config:flags_py",
"//tensorflow/python:array_ops",
"//tensorflow/python:dtypes",
"//tensorflow/python:handle_data_util",
"//tensorflow/python:math_ops",
"//tensorflow/python:tensor_util",
"//tensorflow/python/framework:indexed_slices",
"//tensorflow/python/framework:ops",
],
)
py_strict_library(
name = "forwardprop",
srcs = ["forwardprop.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
":backprop",
":backprop_util",
":execute",
":forwardprop_util",
"//tensorflow/python:array_ops",
"//tensorflow/python:pywrap_tfe",
"//tensorflow/python:unconnected_gradients",
"//tensorflow/python/eager/polymorphic_function:tracing_compiler",
"//tensorflow/python/framework:ops",
"//tensorflow/python/framework:tensor_shape",
"//tensorflow/python/ops/parallel_for:control_flow_ops",
"//tensorflow/python/platform:tf_logging",
"//tensorflow/python/util:nest",
"//tensorflow/python/util:tf_export",
],
)
py_strict_library(
name = "forwardprop_util",
srcs = ["forwardprop_util.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
"//tensorflow/python:pywrap_tfe",
],
)
py_strict_library(
name = "benchmarks_test_base",
srcs = ["benchmarks_test_base.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
":test",
"//tensorflow/python/platform:flags",
],
)
cuda_py_strict_test(
name = "benchmarks_test",
srcs = ["benchmarks_test.py"],
python_version = "PY3",
deps = [
":backprop",
":benchmarks_test_base",
":context",
":core",
":def_function",
":forwardprop",
":test",
"//tensorflow/python:array_ops",
"//tensorflow/python:array_ops_gen",
"//tensorflow/python:cond",
"//tensorflow/python:embedding_ops",
"//tensorflow/python:functional_ops",
"//tensorflow/python:math_ops",
"//tensorflow/python:math_ops_gen",
"//tensorflow/python:nn_ops",
"//tensorflow/python:pywrap_tfe",
"//tensorflow/python:random_ops",
"//tensorflow/python:resource_variable_ops",
"//tensorflow/python/framework:constant_op",
"//tensorflow/python/framework:dtypes",
"//tensorflow/python/framework:ops",
"//tensorflow/python/framework:tensor_shape",
"//tensorflow/python/framework:tensor_spec",
"//tensorflow/python/framework:test_lib",
"//tensorflow/python/ops/ragged:ragged_tensor",
"//tensorflow/python/util:nest",
"//tensorflow/python/util:tf_decorator",
"//third_party/py/numpy",
],
)
cuda_py_strict_test(
name = "run_eager_op_as_function_test",
srcs = ["run_eager_op_as_function_test.py"],
python_version = "PY3",
tags = [
"no_windows", # b/207695287
],
deps = [
":benchmarks_test_base",
":context",
":test",
"//tensorflow/python:array_ops",
"//tensorflow/python:bitwise_ops",
"//tensorflow/python:critical_section_ops",
"//tensorflow/python:framework_test_lib",
"//tensorflow/python:math_ops",
"//tensorflow/python:random_ops",
"//tensorflow/python/data/experimental/ops:prefetching_ops",
"//tensorflow/python/data/ops:dataset_ops",
"//tensorflow/python/framework:constant_op",
"//tensorflow/python/framework:dtypes",
"//tensorflow/python/ops/ragged:ragged_factory_ops",
"//tensorflow/python/ops/ragged:ragged_map_ops",
"//tensorflow/python/ops/ragged:ragged_tensor",
"//tensorflow/python/util:tf_decorator",
],
)
tf_xla_py_test(
name = "run_eager_op_as_function_xla_test",
size = "small",
srcs = ["run_eager_op_as_function_xla_test.py"],
enable_mlir_bridge = False,
enabled_backends = [
"cpu",
"gpu",
],
python_version = "PY3",
tags = [
"multi_and_single_gpu",
"no_pip", # TODO(b/149738646): fix pip install so these tests run on kokoro pip
],
deps = [
":def_function",
":test",
"//tensorflow/compiler/tests:xla_test",
"//tensorflow/python:framework_test_lib",
"//tensorflow/python:resource_variable_ops",
"//tensorflow/python:variables",
],
)
cuda_py_strict_test(
name = "remote_benchmarks_test",
srcs = ["remote_benchmarks_test.py"],
python_version = "PY3",
deps = [
":context",
":def_function",
":remote",
":test",
"//tensorflow/python:math_ops",
"//tensorflow/python:random_ops",
"//tensorflow/python:variables",
"//tensorflow/python/framework:ops",
"//tensorflow/python/training:server_lib",
],
)
tf_py_logged_benchmark(
name = "benchmarks",
python_version = "PY3",
target = "//tensorflow/python/eager:benchmarks_test",
)
tf_py_strict_test(
name = "record_test",
srcs = ["record_test.py"],
python_version = "PY3",
deps = [
":backprop",
":context",
":record",
":test",
"//tensorflow/python:array_ops",
"//tensorflow/python:constant_op",
"//tensorflow/python:dtypes",
"//tensorflow/python:gradients",
"//tensorflow/python:gradients_impl",
"//tensorflow/python:math_ops",
"//tensorflow/python:nn_ops",
"//tensorflow/python:variables",
"//tensorflow/python/ops:nn_grad",
],
)
cuda_py_strict_test(
name = "ops_test",
srcs = ["ops_test.py"],
python_version = "PY3",
deps = [
":context",
":execute",
":test",
"//tensorflow/python:array_ops",
"//tensorflow/python:array_ops_stack",
"//tensorflow/python:config",
"//tensorflow/python:control_flow_ops",
"//tensorflow/python:dtypes",
"//tensorflow/python:errors",
"//tensorflow/python:framework_ops",
"//tensorflow/python:framework_test_lib",
"//tensorflow/python:layers",
"//tensorflow/python:math_ops",
"//tensorflow/python:random_ops",
"//tensorflow/python:resource_variable_ops",
"//tensorflow/python:sparse_ops",
"//tensorflow/python:tensor_shape",
"//tensorflow/python/framework:constant_op",
"//third_party/py/numpy",
"@absl_py//absl/testing:parameterized",
],
)
tf_py_strict_test(
name = "pywrap_tfe_test",
srcs = ["pywrap_tfe_test.py"],
python_version = "PY3",
deps = [
":backprop",
":context",
":core",
":def_function",
":test",
"//tensorflow/python:array_ops",
"//tensorflow/python:array_ops_stack",
"//tensorflow/python:framework_test_lib",
"//tensorflow/python:math_ops",
"//tensorflow/python:pywrap_tfe",
"//tensorflow/python:random_ops",
"//tensorflow/python:resource_variable_ops",
"//tensorflow/python:test_ops",
"//tensorflow/python/framework:constant_op",
"//tensorflow/python/framework:dtypes",
"//tensorflow/python/framework:errors",
"//tensorflow/python/framework:ops",
"//third_party/py/numpy",
],
)
py_strict_library(
name = "imperative_grad",
srcs = ["imperative_grad.py"],
srcs_version = "PY3",
deps = [
"//tensorflow/python:pywrap_tfe",
"//tensorflow/python:unconnected_gradients",
"//tensorflow/python/util:compat",
],
)
# Check that the main TensorFlow python library depends on and links XLA.
check_deps(
name = "def_function_check_deps",
required_deps = [
"//tensorflow/compiler/jit:xla_kernel_creator",
],
deps = [":def_function"],
)
py_strict_library(
name = "def_function",
srcs = ["def_function.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
"//tensorflow/python/eager/polymorphic_function",
"//tensorflow/python/eager/polymorphic_function:eager_function_run",
],
)
py_strict_library(
name = "lift_to_graph",
srcs = ["lift_to_graph.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
"//tensorflow/python:array_ops",
"//tensorflow/python:framework_ops",
"//tensorflow/python:op_selector",
"//tensorflow/python:resource_variable_ops",
"//tensorflow/python/framework:func_graph",
"//tensorflow/python/util:compat",
"//tensorflow/python/util:object_identity",
"//tensorflow/python/util:tf_export",
],
)
tf_py_strict_test(
name = "lift_to_graph_test",
size = "medium",
srcs = ["lift_to_graph_test.py"],
python_version = "PY3",
deps = [
"lift_to_graph",
":def_function",
":test",
"//tensorflow/python:framework_ops",
"//tensorflow/python:math_ops",
"//tensorflow/python:resource_variable_ops",
"//tensorflow/python/framework:constant_op",
"//tensorflow/python/framework:func_graph",
"//tensorflow/python/util:compat",
],
)
py_strict_library(
name = "wrap_function",
srcs = ["wrap_function.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
":context",
":function",
":lift_to_graph",
"//tensorflow/core:protos_all_py",
"//tensorflow/core/function/polymorphism:function_type",
"//tensorflow/python:framework_ops",
"//tensorflow/python:resource_variable_ops",
"//tensorflow/python:variable_scope",
"//tensorflow/python/framework",
"//tensorflow/python/framework:composite_tensor",
"//tensorflow/python/framework:func_graph",
"//tensorflow/python/framework:sparse_tensor",
"//tensorflow/python/framework:tensor_shape",
"//tensorflow/python/framework:tensor_spec",
"//tensorflow/python/framework:tensor_util",
"//tensorflow/python/platform:tf_logging",
"//tensorflow/python/saved_model:nested_structure_coder",
"//tensorflow/python/trackable:data_structures",
"//tensorflow/python/util:nest",
"//tensorflow/python/util:tf_export",
],
)
tf_py_strict_test(
name = "wrap_function_test",
srcs = ["wrap_function_test.py"],
python_version = "PY3",
deps = [
":backprop",
":def_function",
":wrap_function",
"//tensorflow/core:protos_all_py",
"//tensorflow/python:array_ops",
"//tensorflow/python:client_testlib",
"//tensorflow/python:framework_ops",
"//tensorflow/python:init_ops",
"//tensorflow/python:state_ops",
"//tensorflow/python:variable_scope",
"//tensorflow/python:variable_v1",
"//tensorflow/python:variables",
"//tensorflow/python/data/ops:dataset_ops",
"//tensorflow/python/framework",
"//tensorflow/python/framework:constant_op",
"//tensorflow/python/framework:dtypes",
"//tensorflow/python/framework:tensor_spec",
"//tensorflow/python/framework:test_lib",
"//tensorflow/python/ops/ragged:ragged_factory_ops",
"//tensorflow/python/ops/ragged:ragged_tensor",
"//tensorflow/python/training:saver",
],
)
cuda_py_strict_test(
name = "wrap_function_device_test",
srcs = ["wrap_function_device_test.py"],
python_version = "PY3",
xla_enable_strict_auto_jit = False,
xla_enabled = False,
deps = [
":def_function",
":wrap_function",
"//tensorflow/python:client_testlib",
"//tensorflow/python:config",
"//tensorflow/python:constant_op",
"//tensorflow/python:dtypes",
"//tensorflow/python:framework",
"//tensorflow/python:framework_ops",
"//tensorflow/python/data/ops:dataset_ops",
"@absl_py//absl/testing:parameterized",
],
)
py_strict_library(
name = "remote",
srcs = ["remote.py"],
srcs_version = "PY3",
visibility = ["//tensorflow:internal"],
deps = [
":context",
"//tensorflow/core:protos_all_py",
"//tensorflow/python:pywrap_tfe",
"//tensorflow/python/distribute:device_util",
"//tensorflow/python/distribute/cluster_resolver:base_cluster_resolver_py",
"//tensorflow/python/framework:ops",
"//tensorflow/python/platform:remote_utils",
"//tensorflow/python/training:server_lib",
"//tensorflow/python/util:nest",
"//tensorflow/python/util:tf_export",
"@absl_py//absl/logging",
] + tf_additional_rpc_deps(),
)
cuda_py_strict_test(
name = "remote_test",
size = "medium",
srcs = ["remote_test.py"],
grpc_enabled = True,
python_version = "PY3",
shard_count = 2,
tags = [
"no_oss", # This test launches local server.
"nofastbuild", # times out
"optonly", # times out
],
deps = [
":cancellation",
":context",
":def_function",
":executor",
":remote",
":test",
"//tensorflow/python:array_ops",
"//tensorflow/python:array_ops_stack",
"//tensorflow/python:data_flow_ops",
"//tensorflow/python:dtypes",
"//tensorflow/python:functional_ops",
"//tensorflow/python:math_ops",
"//tensorflow/python:resource_variable_ops",
"//tensorflow/python:string_ops",
"//tensorflow/python:tensor_spec",
"//tensorflow/python:test_ops",
"//tensorflow/python:variables",
"//tensorflow/python:while_loop",
"//tensorflow/python/data/ops:dataset_ops",
"//tensorflow/python/distribute/cluster_resolver:base_cluster_resolver_py",
"//tensorflow/python/framework:constant_op",
"//tensorflow/python/framework:errors",
"//tensorflow/python/framework:ops",
"//tensorflow/python/framework:test_lib",
"//tensorflow/python/training:server_lib",
"//tensorflow/python/util:compat",
"@absl_py//absl/testing:parameterized",
],
)
cuda_py_strict_test(
name = "remote_execution_test",
srcs = ["remote_execution_test.py"],
grpc_enabled = True,
python_version = "PY3",
shard_count = 8,
tags = [
"no_oss", # This test launches local server
],
deps = [
":backprop",
":context",
":def_function",
":remote",
"//tensorflow/core:protos_all_py",
"//tensorflow/python:array_ops",
"//tensorflow/python:constant_op",
"//tensorflow/python:math_ops",
"//tensorflow/python:pywrap_tfe",
"//tensorflow/python:resource_variable_ops",
"//tensorflow/python:script_ops",
"//tensorflow/python/framework:dtypes",
"//tensorflow/python/framework:ops",
"//tensorflow/python/framework:test_lib",
"//tensorflow/python/platform:client_testlib",
"//tensorflow/python/training:server_lib",
"@absl_py//absl/testing:parameterized",
],
)
cuda_py_strict_test(
name = "remote_cluster_test",
srcs = ["remote_cluster_test.py"],
grpc_enabled = True,
python_version = "PY3",
shard_count = 8,
tags = [
"no_oss", # This test launches local server
"no_tfrt", # TODO(b/171765113)
"notsan", # TODO(b/170783249)
],
deps = [
":context",
":def_function",
":executor",
"//tensorflow/core:protos_all_py",
"//tensorflow/python:array_ops",
"//tensorflow/python:math_ops",
"//tensorflow/python:pywrap_tfe",
"//tensorflow/python:variables",
"//tensorflow/python/distribute/failure_handling:check_preemption_py",
"//tensorflow/python/framework:errors",
"//tensorflow/python/framework:test_lib",
"//tensorflow/python/platform:client_testlib",
"//tensorflow/python/training:coordinator",
"//tensorflow/python/training:server_lib",
"@absl_py//absl/testing:parameterized",
],
)
tpu_py_strict_test(
name = "remote_cloud_tpu_test",
srcs = ["remote_cloud_tpu_test.py"],
python_version = "PY3",
tags = [
"notap",
],
deps = [
":remote",
"//tensorflow/python/distribute/cluster_resolver:tpu_cluster_resolver_py",
"//tensorflow/python/framework:config",
"@absl_py//absl/flags",
"@absl_py//absl/testing:absltest",
],
)
tpu_py_strict_test(
name = "remote_cloud_tpu_pod_test",
srcs = ["remote_cloud_tpu_test.py"],
args = ["--num_tpu_devices=32"],
main = "remote_cloud_tpu_test.py",
python_version = "PY3",
tags = [
"notap",
"tpu_pod",
],
deps = [
":remote",
"//tensorflow/python/distribute/cluster_resolver:tpu_cluster_resolver_py",
"//tensorflow/python/framework:config",
"//tensorflow/python/tpu:tpu_strategy_util",
"@absl_py//absl/flags",
"@absl_py//absl/testing:absltest",
],
)
cuda_py_strict_test(
name = "device_placement_test",
size = "small",
srcs = ["device_placement_test.py"],
python_version = "PY3",
shard_count = 5,
deps = [
":context",
":def_function",
":remote",
":test",
"//tensorflow/python:array_ops",
"//tensorflow/python:math_ops",
"//tensorflow/python:random_ops",
"//tensorflow/python/framework:config",
"//tensorflow/python/framework:constant_op",
"//tensorflow/python/framework:dtypes",
"//tensorflow/python/framework:errors",
"//tensorflow/python/framework:ops",
"//tensorflow/python/framework:test_lib",
"@absl_py//absl/testing:parameterized",
],
)
py_library(
name = "gradient_input_output_exclusions",
srcs = ["gradient_input_output_exclusions.py"],
srcs_version = "PY3",
deps = [
"//tensorflow:tensorflow_py",
],
)
py_strict_binary(
name = "gen_gradient_input_output_exclusions",
srcs = ["gen_gradient_input_output_exclusions.py"],
deps = [":gradient_input_output_exclusions"],
)
# Needed for the test below.
exports_files([
"pywrap_gradient_exclusions.cc",
])
py_strict_test(
name = "gradient_input_output_exclusions_test",
srcs = ["gradient_input_output_exclusions_test.py"],
data = [
":pywrap_gradient_exclusions.cc",
],
python_version = "PY3",
srcs_version = "PY3",
tags = [
"no_pip", # No point linking the gen script in the pip package.
],
deps = [
":gradient_input_output_exclusions",
"//tensorflow/python:client_testlib",
"//tensorflow/python:lib",
"//tensorflow/python/platform:resource_loader",
],
)