• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1"""External versions of build rules that differ outside of Google."""
2
3load(
4    "//tensorflow:tensorflow.bzl",
5    "clean_dep",
6)
7
8def tflite_portable_test_suite(**kwargs):
9    """This is a no-op outside of Google."""
10    _ignore = [kwargs]
11    pass
12
13def tflite_portable_test_suite_combined(**kwargs):
14    """This is a no-op outside of Google."""
15    _ignore = [kwargs]
16    pass
17
18def tflite_ios_per_kernel_test(**kwargs):
19    """This is a no-op outside of Google."""
20    _ignore = [kwargs]
21    pass
22
23def ios_visibility_whitelist():
24    """This is a no-op outside of Google."""
25    pass
26
27def internal_visibility_allowlist():
28    """Grant public visibility to internal targets so that other repos can depend on them."""
29    return [
30        "//visibility:public",
31    ]
32
33def tflite_extra_gles_deps():
34    """This is a no-op outside of Google."""
35    return []
36
37def tflite_ios_lab_runner(version):
38    """This is a no-op outside of Google."""
39
40    # Can switch back to None when https://github.com/bazelbuild/rules_apple/pull/757 is fixed
41    return "@build_bazel_rules_apple//apple/testing/default_runner:ios_default_runner"
42
43def if_nnapi(supported, not_supported = [], supported_android = None):
44    if supported_android == None:
45        supported_android = supported
46
47    # We use a blacklist rather than a whitelist for known unsupported platforms.
48    return select({
49        clean_dep("//tensorflow:emscripten"): not_supported,
50        clean_dep("//tensorflow:ios"): not_supported,
51        clean_dep("//tensorflow:macos"): not_supported,
52        clean_dep("//tensorflow:windows"): not_supported,
53        clean_dep("//tensorflow:android"): supported_android,
54        "//conditions:default": supported,
55    })
56
57def tflite_hexagon_mobile_test(name):
58    """This is a no-op outside of Google."""
59    pass
60
61def tflite_hexagon_nn_skel_libraries():
62    """This is a no-op outside of Google due to license agreement process.
63
64    Developers who want to use hexagon nn skel libraries can download
65    and install the libraries as the guided in
66    https://www.tensorflow.org/lite/performance/hexagon_delegate#step_2_add_hexagon_libraries_to_your_android_app.
67    For example, if you installed the libraries at third_party/hexagon_nn_skel
68    and created third_party/hexagon_nn_skel/BUILD with a build target,
69    filegroup(
70        name = "libhexagon_nn_skel",
71        srcs = glob(["*.so"]),
72    )
73    you need to modify this macro to specify the build target.
74    return ["//third_party/hexagon_nn_skel:libhexagon_nn_skel"]
75    """
76    return []
77
78def tflite_schema_utils_friends():
79    """This is a no-op outside of Google.
80
81    Return the package group declaration to which targets for Flatbuffer schema utilities."""
82
83    # Its usage should be rare, and is often abused by tools that are doing
84    # Flatbuffer creation/manipulation in unofficially supported ways."
85    return ["//..."]
86
87def flex_portable_tensorflow_deps():
88    """Returns dependencies for building portable tensorflow in Flex delegate."""
89
90    return [
91        "//third_party/fft2d:fft2d_headers",
92        "//third_party/eigen3",
93        "@com_google_absl//absl/types:optional",
94        "@com_google_absl//absl/strings:str_format",
95        "@gemmlowp",
96        "@icu//:common",
97        "//third_party/icu/data:conversion_data",
98    ]
99
100def tflite_copts_extra():
101    """Defines extra compile time flags for tflite_copts(). Currently empty."""
102    return []
103