Skip to content

Commit

Permalink
Cleanup header file usage.
Browse files Browse the repository at this point in the history
Add decompression code to Bazel BUILD files
  • Loading branch information
ddavis-2015 committed Oct 20, 2024
1 parent 4a02b22 commit 821dfdf
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 4 deletions.
16 changes: 15 additions & 1 deletion tensorflow/lite/micro/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ tflm_cc_library(
],
)

tflm_cc_library(
name = "compression",
hdrs = [
"compression.h",
],
deps = [
"//tensorflow/lite/c:common",
],
)

tflm_cc_library(
# TODO(b/187093492): Rename to micro_interpreter.
name = "micro_framework",
Expand Down Expand Up @@ -63,12 +73,14 @@ tflm_cc_library(
"micro_context.h",
],
deps = [
":compression",
":micro_common",
":micro_graph",
":micro_log",
":micro_profiler",
"//tensorflow/lite/c:common",
"//tensorflow/lite:type_to_tflitetype",
"//tensorflow/lite/micro/kernels:decompress",
],
)

Expand Down Expand Up @@ -165,7 +177,6 @@ tflm_cc_library(
tflm_cc_library(
name = "micro_allocator",
srcs = [
"compression.h",
"micro_allocation_info.cc",
"micro_allocator.cc",
],
Expand All @@ -174,6 +185,7 @@ tflm_cc_library(
"micro_allocator.h",
],
deps = [
":compression",
":flatbuffer_utils",
":memory_helpers",
":micro_arena_constants",
Expand Down Expand Up @@ -240,7 +252,9 @@ tflm_cc_library(
"test_helpers.h",
],
deps = [
":compression",
":memory_helpers",
":micro_log",
":micro_utils",
":op_resolvers",
"//tensorflow/lite:type_to_tflitetype",
Expand Down
42 changes: 42 additions & 0 deletions tensorflow/lite/micro/kernels/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,30 @@ tflm_cc_library(
],
)

tflm_cc_library(
name = "decompress",
srcs = [
"decompress.cc",
"decompress_common.cc",
],
hdrs = [
"decompress.h",
],
visibility = [
":kernel_friends",
":tflite_micro",
],
deps = [
"//tensorflow/lite:type_to_tflitetype",
"//tensorflow/lite/kernels/internal:compatibility",
"//tensorflow/lite/micro:compression",
"//tensorflow/lite/micro:micro_common",
"//tensorflow/lite/micro:micro_log",
"//tensorflow/lite/micro:micro_profiler",
"//tensorflow/lite/micro:micro_utils",
],
)

tflm_cc_library(
name = "detection_postprocess_flexbuffers_generated_data",
srcs = [
Expand Down Expand Up @@ -612,6 +636,24 @@ tflm_cc_test(
],
)

tflm_cc_test(
name = "decompress_test",
srcs = [
"decompress_test.cc",
],
deps = [
"//tensorflow/lite/c:common",
"//tensorflow/lite/micro:micro_log",
"//tensorflow/lite/micro:micro_arena_constants",
"//tensorflow/lite/micro:test_helpers",
"//tensorflow/lite/micro/testing:micro_test",
],
target_compatible_with = select({
"//conditions:default": ["@platforms//:incompatible"],
"//:with_compression_enabled": [],
}),
)

tflm_cc_test(
name = "depth_to_space_test",
srcs = [
Expand Down
1 change: 0 additions & 1 deletion tensorflow/lite/micro/kernels/decompress.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ limitations under the License.
#include "tensorflow/lite/micro/micro_log.h"
#include "tensorflow/lite/micro/micro_profiler.h"
#include "tensorflow/lite/micro/micro_utils.h"
#include "tensorflow/lite/portable_type_to_tflitetype.h"

namespace tflite {

Expand Down
2 changes: 0 additions & 2 deletions tensorflow/lite/micro/kernels/decompress_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ limitations under the License.
#include <initializer_list>
#include <type_traits>

#include "tensorflow/lite/c/builtin_op_data.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/micro//micro_log.h"
#include "tensorflow/lite/micro/kernels/kernel_runner.h"
#include "tensorflow/lite/micro/micro_arena_constants.h"
#include "tensorflow/lite/micro/test_helpers.h"
#include "tensorflow/lite/micro/testing/micro_test.h"
Expand Down

0 comments on commit 821dfdf

Please sign in to comment.