Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions python/tflite_micro/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ load(
)
load(
"//tensorflow/lite/micro:build_def.bzl",
"INCOMPATIBLE_WITH_WINDOWS",
"tflm_cc_library",
)
load("//tools:expand_stamp_vars.bzl", "expand_stamp_vars")
Expand Down Expand Up @@ -91,10 +92,7 @@ py_test(
"nomsan", # Python doesn't like these symbols in _runtime.so
"noubsan",
],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":runtime",
requirement("numpy"),
Expand Down Expand Up @@ -311,8 +309,5 @@ sh_test(
"notap", # See http://b/294278650#comment4 for more details.
"noubsan",
],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
)
28 changes: 12 additions & 16 deletions python/tflite_micro/signal/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ load("@rules_python//python:defs.bzl", "py_library", "py_test")
load("@tflm_pip_deps//:requirements.bzl", "requirement")
load("//python/tflite_micro/signal:tflm_signal.bzl", "py_tflm_signal_library")
load("//tensorflow:extra_rules.bzl", "tflm_signal_friends")
load("//tensorflow/lite/micro:build_def.bzl", "INCOMPATIBLE_WITH_WINDOWS")

package(
default_visibility = [":__subpackages__"],
Expand All @@ -14,14 +15,9 @@ package_group(
packages = tflm_signal_friends(),
)

TARGET_COMPATIBLE_WITH = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
})

cc_library(
name = "ops_lib",
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
visibility = [":signal_friends"],
deps = [
":delay_op_cc",
Expand All @@ -42,7 +38,7 @@ py_library(
"__init__.py",
"ops/__init__.py",
],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
visibility = ["//visibility:public"],
deps = [
":delay_op",
Expand Down Expand Up @@ -78,7 +74,7 @@ py_test(
"nomsan",
"noubsan",
],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":delay_op",
requirement("numpy"),
Expand Down Expand Up @@ -110,7 +106,7 @@ py_test(
"nomsan",
"noubsan",
],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":energy_op",
requirement("numpy"),
Expand Down Expand Up @@ -142,7 +138,7 @@ py_test(
"nomsan",
"noubsan",
],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":fft_ops",
requirement("numpy"),
Expand Down Expand Up @@ -180,7 +176,7 @@ py_test(
"nomsan",
"noubsan",
],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":filter_bank_ops",
requirement("numpy"),
Expand Down Expand Up @@ -212,7 +208,7 @@ py_test(
"nomsan",
"noubsan",
],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":framer_op",
requirement("numpy"),
Expand Down Expand Up @@ -241,7 +237,7 @@ py_test(
"nomsan",
"noubsan",
],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":overlap_add_op",
requirement("absl_py"),
Expand Down Expand Up @@ -274,7 +270,7 @@ py_test(
"nomsan",
"noubsan",
],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":pcan_op",
requirement("numpy"),
Expand Down Expand Up @@ -306,7 +302,7 @@ py_test(
"nomsan",
"noubsan",
],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":stacker_op",
requirement("numpy"),
Expand Down Expand Up @@ -337,7 +333,7 @@ py_test(
"nomsan",
"noubsan",
],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":window_op",
requirement("numpy"),
Expand Down
20 changes: 8 additions & 12 deletions python/tflite_micro/signal/utils/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")
# Signal python utilities.
load("@rules_python//python:defs.bzl", "py_library", "py_test")
load("@tflm_pip_deps//:requirements.bzl", "requirement")
load("//tensorflow/lite/micro:build_def.bzl", "INCOMPATIBLE_WITH_WINDOWS")

package(
default_visibility = [
Expand All @@ -11,11 +12,6 @@ package(
licenses = ["notice"],
)

TARGET_COMPATIBLE_WITH = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
})

py_test(
name = "freq_to_mel_test",
srcs = ["freq_to_mel_test.py"],
Expand All @@ -27,29 +23,29 @@ py_test(
"nomsan",
"noubsan",
],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
)

py_library(
name = "freq_to_mel",
data = [
":freq_to_mel_wrapper.so",
],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
)

pybind_extension(
name = "freq_to_mel_wrapper", # :freq_to_mel_wrapper.so
srcs = [
"freq_to_mel_wrapper.cc",
],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
)

py_library(
name = "util",
srcs = ["util.py"],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
visibility = ["//visibility:public"],
deps = [
requirement("tensorflow"),
Expand All @@ -62,15 +58,15 @@ pybind_extension(
srcs = [
"wide_dynamic_func_lut_wrapper.cc",
],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
)

py_library(
name = "wide_dynamic_func_lut",
data = [
":wide_dynamic_func_lut_wrapper.so",
],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
)

py_test(
Expand All @@ -84,6 +80,6 @@ py_test(
"nomsan",
"noubsan",
],
target_compatible_with = TARGET_COMPATIBLE_WITH,
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
visibility = ["//visibility:public"],
)
5 changes: 5 additions & 0 deletions tensorflow/lite/micro/build_def.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_cc//cc:cc_test.bzl", "cc_test")

INCOMPATIBLE_WITH_WINDOWS = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
})

def tflm_copts():
"""Returns the default copts for targets in TFLM.

Expand Down
41 changes: 9 additions & 32 deletions tensorflow/lite/micro/compression/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ load("@rules_shell//shell:sh_test.bzl", "sh_test")
load("@tflm_pip_deps//:requirements.bzl", "requirement")
load(
"//tensorflow/lite/micro:build_def.bzl",
"INCOMPATIBLE_WITH_WINDOWS",
"tflm_cc_library",
"tflm_cc_test",
)
Expand Down Expand Up @@ -75,10 +76,7 @@ sh_test(
"metadata_saved.h",
":metadata_cc_srcs",
],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
)

tflm_cc_test(
Expand All @@ -105,10 +103,7 @@ py_test(
size = "small",
srcs = ["metadata_test.py"],
main = "metadata_test.py",
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
"metadata_py",
"@flatbuffers//:runtime_py",
Expand Down Expand Up @@ -154,10 +149,7 @@ py_test(
"nomsan", # Sanitizer symbols don't work with Python extension libs
"noubsan",
],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":compress",
":metadata_py",
Expand All @@ -184,10 +176,7 @@ py_test(
name = "model_facade_test",
size = "small",
srcs = ["model_facade_test.py"],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":model_facade",
":test_models",
Expand All @@ -207,10 +196,7 @@ py_test(
name = "spec_test",
size = "small",
srcs = ["spec_test.py"],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":spec",
requirement("tensorflow"),
Expand All @@ -229,10 +215,7 @@ py_test(
name = "spec_builder_test",
size = "small",
srcs = ["spec_builder_test.py"],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":spec",
":spec_builder",
Expand All @@ -254,10 +237,7 @@ py_test(
name = "test_models_test",
size = "small",
srcs = ["test_models_test.py"],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":test_models",
"//tensorflow/lite/python:schema_py",
Expand All @@ -270,10 +250,7 @@ py_binary(
srcs = [
"view.py",
],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":metadata_py",
"//tensorflow/lite/python:schema_py",
Expand Down
6 changes: 2 additions & 4 deletions tensorflow/lite/micro/compression/view_tests.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("@rules_python//python:defs.bzl", "py_test")
load("@tflm_pip_deps//:requirements.bzl", "requirement")
load("//tensorflow/lite/micro:build_def.bzl", "INCOMPATIBLE_WITH_WINDOWS")

def generate_view_tests(targets):
"""Generates py_test targets for each target's path and a test_suite to
Expand All @@ -19,10 +20,7 @@ def generate_view_tests(targets):
args = ["$(location {})".format(target)],
main = "view_test.py",
data = [target],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
target_compatible_with = INCOMPATIBLE_WITH_WINDOWS,
deps = [
":view",
requirement("absl_py"),
Expand Down
Loading