Change TFLite python:interpreter target environment constraints to non_prod.

PiperOrigin-RevId: 335710234
Change-Id: I4c8ab9249590b5577d262bdd306e3c83dd9dac40
This commit is contained in:
A. Unique TensorFlower 2020-10-06 13:37:02 -07:00 committed by TensorFlower Gardener
parent 2d5f9fac35
commit 2f9ba0aae7
11 changed files with 40 additions and 1 deletions

View File

@ -19,6 +19,9 @@ load("//tensorflow/core/kernels/mlir_generated:build_defs.bzl", "if_mlir_generat
# buildifier: disable=same-origin-load # buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "cc_header_only_library") load("//tensorflow:tensorflow.bzl", "cc_header_only_library")
# buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
# buildifier: disable=same-origin-load # buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "tf_kernel_library") load("//tensorflow:tensorflow.bzl", "tf_kernel_library")
@ -890,6 +893,7 @@ cc_library(
hdrs = [ hdrs = [
"eigen_spatial_convolutions-inl.h", "eigen_spatial_convolutions-inl.h",
], ],
compatible_with = get_compatible_with_portable(),
deps = [ deps = [
":eigen_convolution_helpers", ":eigen_convolution_helpers",
], ],
@ -900,6 +904,7 @@ cc_library(
hdrs = [ hdrs = [
"eigen_convolution_helpers.h", "eigen_convolution_helpers.h",
], ],
compatible_with = get_compatible_with_portable(),
) )
# OpKernel libraries ---------------------------------------------------------- # OpKernel libraries ----------------------------------------------------------

View File

@ -1013,6 +1013,7 @@ cc_library(
filegroup( filegroup(
name = "tensor_float_32_hdr", name = "tensor_float_32_hdr",
srcs = ["tensor_float_32_utils.h"], srcs = ["tensor_float_32_utils.h"],
compatible_with = get_compatible_with_portable(),
) )
tf_cc_tests( tf_cc_tests(

View File

@ -673,6 +673,7 @@ cc_library(
cc_library( cc_library(
name = "stateful_error_reporter", name = "stateful_error_reporter",
hdrs = ["stateful_error_reporter.h"], hdrs = ["stateful_error_reporter.h"],
compatible_with = get_compatible_with_portable(),
deps = ["//tensorflow/lite/core/api"], deps = ["//tensorflow/lite/core/api"],
) )

View File

@ -1,3 +1,5 @@
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package( package(
default_visibility = ["//tensorflow:internal"], default_visibility = ["//tensorflow:internal"],
licenses = ["notice"], # Apache 2.0 licenses = ["notice"], # Apache 2.0
@ -6,6 +8,7 @@ package(
cc_library( cc_library(
name = "tflite_api_dispatcher", name = "tflite_api_dispatcher",
hdrs = ["tflite_api_dispatcher.h"], hdrs = ["tflite_api_dispatcher.h"],
compatible_with = get_compatible_with_portable(),
deps = [ deps = [
"//tensorflow/lite:framework_lib", "//tensorflow/lite:framework_lib",
], ],

View File

@ -263,6 +263,7 @@ cc_library(
hdrs = [ hdrs = [
"eigen_support.h", "eigen_support.h",
], ],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts() + EXTRA_EIGEN_COPTS, copts = tflite_copts() + EXTRA_EIGEN_COPTS,
visibility = ["//visibility:private"], visibility = ["//visibility:private"],
deps = [ deps = [
@ -300,6 +301,7 @@ cc_library(
cc_library( cc_library(
name = "tflite_with_ruy_default", name = "tflite_with_ruy_default",
compatible_with = get_compatible_with_portable(),
visibility = ["//visibility:private"], visibility = ["//visibility:private"],
deps = select({ deps = select({
":chromiumos_arm64": [":tflite_with_ruy_enabled"], ":chromiumos_arm64": [":tflite_with_ruy_enabled"],

View File

@ -347,6 +347,7 @@ cc_library(
"optimized/eigen_tensor_reduced_instantiations_oss.h", "optimized/eigen_tensor_reduced_instantiations_oss.h",
"optimized/multithreaded_conv.h", "optimized/multithreaded_conv.h",
], ],
compatible_with = get_compatible_with_portable(),
copts = tflite_copts(), copts = tflite_copts(),
deps = [ deps = [
":common", ":common",

View File

@ -1,4 +1,5 @@
load("@flatbuffers//:build_defs.bzl", "flatbuffer_py_library") load("@flatbuffers//:build_defs.bzl", "flatbuffer_py_library")
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package( package(
default_visibility = ["//tensorflow:internal"], default_visibility = ["//tensorflow:internal"],
@ -17,6 +18,7 @@ py_library(
srcs = [ srcs = [
"interpreter.py", "interpreter.py",
], ],
compatible_with = get_compatible_with_portable(),
srcs_version = "PY2AND3", srcs_version = "PY2AND3",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [

View File

@ -1,5 +1,8 @@
load("//tensorflow:tensorflow.bzl", "pybind_extension") load("//tensorflow:tensorflow.bzl", "pybind_extension")
# buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package( package(
default_visibility = ["//visibility:public"], default_visibility = ["//visibility:public"],
licenses = ["notice"], # Apache 2.0 licenses = ["notice"], # Apache 2.0
@ -9,6 +12,7 @@ cc_library(
name = "numpy", name = "numpy",
srcs = ["numpy.cc"], srcs = ["numpy.cc"],
hdrs = ["numpy.h"], hdrs = ["numpy.h"],
compatible_with = get_compatible_with_portable(),
deps = [ deps = [
"//tensorflow/lite:string_util", "//tensorflow/lite:string_util",
"//tensorflow/lite/c:common", "//tensorflow/lite/c:common",
@ -23,6 +27,7 @@ cc_library(
hdrs = [ hdrs = [
"interpreter_wrapper.h", "interpreter_wrapper.h",
], ],
compatible_with = get_compatible_with_portable(),
deps = [ deps = [
":numpy", ":numpy",
":python_error_reporter", ":python_error_reporter",
@ -45,6 +50,7 @@ cc_library(
name = "python_error_reporter", name = "python_error_reporter",
srcs = ["python_error_reporter.cc"], srcs = ["python_error_reporter.cc"],
hdrs = ["python_error_reporter.h"], hdrs = ["python_error_reporter.h"],
compatible_with = get_compatible_with_portable(),
deps = [ deps = [
"//tensorflow/lite:stateful_error_reporter", "//tensorflow/lite:stateful_error_reporter",
"//third_party/python_runtime:headers", # buildcleaner: keep "//third_party/python_runtime:headers", # buildcleaner: keep
@ -55,6 +61,7 @@ cc_library(
name = "python_utils", name = "python_utils",
srcs = ["python_utils.cc"], srcs = ["python_utils.cc"],
hdrs = ["python_utils.h"], hdrs = ["python_utils.h"],
compatible_with = get_compatible_with_portable(),
deps = [ deps = [
"//tensorflow/lite:framework", "//tensorflow/lite:framework",
"//tensorflow/lite:string_util", "//tensorflow/lite:string_util",
@ -75,6 +82,7 @@ pybind_extension(
"interpreter_wrapper_pybind11.cc", "interpreter_wrapper_pybind11.cc",
], ],
hdrs = ["interpreter_wrapper.h"], hdrs = ["interpreter_wrapper.h"],
compatible_with = get_compatible_with_portable(),
link_in_framework = True, link_in_framework = True,
module_name = "_pywrap_tensorflow_interpreter_wrapper", module_name = "_pywrap_tensorflow_interpreter_wrapper",
deps = [ deps = [

View File

@ -8,6 +8,9 @@ load("//tensorflow:tensorflow.bzl", "cc_header_only_library", "if_mlir", "if_not
# buildifier: disable=same-origin-load # buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "get_compatible_with_cloud") load("//tensorflow:tensorflow.bzl", "get_compatible_with_cloud")
# buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
# buildifier: disable=same-origin-load # buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "tf_monitoring_python_deps") load("//tensorflow:tensorflow.bzl", "tf_monitoring_python_deps")
@ -602,6 +605,7 @@ cc_library(
cc_library( cc_library(
name = "pybind11_lib", name = "pybind11_lib",
hdrs = ["lib/core/pybind11_lib.h"], hdrs = ["lib/core/pybind11_lib.h"],
compatible_with = get_compatible_with_portable(),
features = ["-parse_headers"], features = ["-parse_headers"],
visibility = tf_external_workspace_visible(visibility), visibility = tf_external_workspace_visible(visibility),
deps = [ deps = [
@ -806,6 +810,7 @@ tf_python_pybind_extension(
name = "_pywrap_tensor_float_32_execution", name = "_pywrap_tensor_float_32_execution",
srcs = ["util/tensor_float_32.cc"], srcs = ["util/tensor_float_32.cc"],
hdrs = ["//tensorflow/core/platform:tensor_float_32_hdr"], hdrs = ["//tensorflow/core/platform:tensor_float_32_hdr"],
compatible_with = get_compatible_with_portable(),
module_name = "_pywrap_tensor_float_32_execution", module_name = "_pywrap_tensor_float_32_execution",
deps = [ deps = [
"@pybind11", "@pybind11",
@ -5469,6 +5474,7 @@ py_library(
py_strict_library( py_strict_library(
name = "tf_export", name = "tf_export",
srcs = ["util/tf_export.py"], srcs = ["util/tf_export.py"],
compatible_with = get_compatible_with_portable(),
srcs_version = "PY2AND3", srcs_version = "PY2AND3",
visibility = ["//tensorflow:__subpackages__"], visibility = ["//tensorflow:__subpackages__"],
deps = [ deps = [
@ -5497,6 +5503,7 @@ py_strict_library(
"util/tf_decorator.py", "util/tf_decorator.py",
"util/tf_inspect.py", "util/tf_inspect.py",
], ],
compatible_with = get_compatible_with_portable(),
srcs_version = "PY2AND3", srcs_version = "PY2AND3",
visibility = [ visibility = [
"//tensorflow:__subpackages__", "//tensorflow:__subpackages__",
@ -5514,6 +5521,7 @@ py_strict_library(
py_strict_library( py_strict_library(
name = "tf_stack", name = "tf_stack",
srcs = ["util/tf_stack.py"], srcs = ["util/tf_stack.py"],
compatible_with = get_compatible_with_portable(),
srcs_version = "PY2AND3", srcs_version = "PY2AND3",
# TODO(mdan): Remove public visibility. # TODO(mdan): Remove public visibility.
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
@ -5526,6 +5534,7 @@ py_strict_library(
pybind_extension( pybind_extension(
name = "_tf_stack", name = "_tf_stack",
srcs = ["util/tf_stack.cc"], srcs = ["util/tf_stack.cc"],
compatible_with = get_compatible_with_portable(),
# TODO(b/138203821): change to "util._tf_stack" once the bug is fixed. # TODO(b/138203821): change to "util._tf_stack" once the bug is fixed.
module_name = "_tf_stack", module_name = "_tf_stack",
deps = [ deps = [
@ -5610,6 +5619,7 @@ tf_py_test(
py_library( py_library(
name = "global_test_configuration", name = "global_test_configuration",
compatible_with = get_compatible_with_portable(),
deps = if_mlir(["//tensorflow/compiler/mlir/tensorflow:mlir_roundtrip_pass_registration"]) + deps = if_mlir(["//tensorflow/compiler/mlir/tensorflow:mlir_roundtrip_pass_registration"]) +
tf_enable_mlir_bridge(), tf_enable_mlir_bridge(),
) )
@ -5628,6 +5638,7 @@ py_library(
"util/**/*_test.py", "util/**/*_test.py",
], ],
), ),
compatible_with = get_compatible_with_portable(),
srcs_version = "PY2AND3", srcs_version = "PY2AND3",
visibility = visibility + [ visibility = visibility + [
"//tensorflow:__pkg__", "//tensorflow:__pkg__",

View File

@ -2767,7 +2767,8 @@ def tf_python_pybind_extension(
deps = [], deps = [],
defines = [], defines = [],
visibility = None, visibility = None,
testonly = None): testonly = None,
compatible_with = None):
"""A wrapper macro for pybind_extension that is used in tensorflow/python/BUILD. """A wrapper macro for pybind_extension that is used in tensorflow/python/BUILD.
Please do not use it anywhere else as it may behave unexpectedly. b/146445820 Please do not use it anywhere else as it may behave unexpectedly. b/146445820
@ -2787,6 +2788,7 @@ def tf_python_pybind_extension(
visibility = visibility, visibility = visibility,
link_in_framework = True, link_in_framework = True,
testonly = testonly, testonly = testonly,
compatible_with = compatible_with,
) )
def tf_pybind_cc_library_wrapper(name, deps, visibility = None, **kwargs): def tf_pybind_cc_library_wrapper(name, deps, visibility = None, **kwargs):

View File

@ -4,6 +4,7 @@ load(
"tf_cc_test", # @unused "tf_cc_test", # @unused
"tf_copts", # @unused "tf_copts", # @unused
) )
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
package( package(
default_visibility = ["//tensorflow:internal"], default_visibility = ["//tensorflow:internal"],
@ -80,6 +81,7 @@ py_test(
py_library( py_library(
name = "renames_v2", name = "renames_v2",
srcs = ["renames_v2.py"], srcs = ["renames_v2.py"],
compatible_with = get_compatible_with_portable(),
srcs_version = "PY2AND3", srcs_version = "PY2AND3",
) )
@ -92,6 +94,7 @@ py_library(
py_library( py_library(
name = "all_renames_v2", name = "all_renames_v2",
srcs = ["all_renames_v2.py"], srcs = ["all_renames_v2.py"],
compatible_with = get_compatible_with_portable(),
srcs_version = "PY2AND3", srcs_version = "PY2AND3",
visibility = [ visibility = [
"//tensorflow:__pkg__", "//tensorflow:__pkg__",