Merge pull request #47018 from advaitjain:remove-models-from-tflm-lib

PiperOrigin-RevId: 356621453
Change-Id: I164eb212e15f25172a91075ab34a5baf71b6d113
This commit is contained in:
TensorFlower Gardener 2021-02-09 16:48:59 -08:00
commit fc108e0865
2 changed files with 49 additions and 5 deletions

View File

@ -3,7 +3,8 @@ tensorflow/lite/micro/benchmarks/keyword_benchmark.cc \
tensorflow/lite/micro/benchmarks/keyword_scrambled_model_data.cc
KEYWORD_BENCHMARK_HDRS := \
tensorflow/lite/micro/benchmarks/keyword_scrambled_model_data.h
tensorflow/lite/micro/benchmarks/keyword_scrambled_model_data.h \
tensorflow/lite/micro/benchmarks/micro_benchmark.h
PERSON_DETECTION_BENCHMARK_SRCS := \
tensorflow/lite/micro/benchmarks/person_detection_benchmark.cc \
@ -20,4 +21,3 @@ $(KEYWORD_BENCHMARK_SRCS),$(KEYWORD_BENCHMARK_HDRS)))
$(eval $(call microlite_test,person_detection_benchmark,\
$(PERSON_DETECTION_BENCHMARK_SRCS),$(PERSON_DETECTION_BENCHMARK_HDRS)))

View File

@ -366,9 +366,7 @@ $(wildcard tensorflow/lite/micro/testing/*.h)
MICROLITE_CC_BASE_SRCS := \
$(wildcard tensorflow/lite/micro/*.cc) \
$(wildcard tensorflow/lite/micro/benchmarks/*model_data.cc) \
$(wildcard tensorflow/lite/micro/memory_planner/*.cc) \
$(wildcard tensorflow/lite/micro/testing/*model.cc) \
tensorflow/lite/c/common.c \
tensorflow/lite/core/api/error_reporter.cc \
tensorflow/lite/core/api/flatbuffer_conversions.cc \
@ -665,9 +663,55 @@ $(BINDIR)%.bin: $(BINDIR)%
@mkdir -p $(dir $@)
$(OBJCOPY) $< $@ -O binary
# Generate standalone makefile projects for all of the test targets.
# Some tests have additional dependencies (beyond libtensorflow-microlite.a) and
# those need to be explicitly specified with their own individual call to the
# microlite_test helper function. For these tests, we also need to make sure to
# not add targets for them if they have been excluded as part of the target
# specific Makefile.
EXPLICITLY_SPECIFIED_TEST:= tensorflow/lite/micro/memory_arena_threshold_test.cc
ifneq ($(findstring $(EXPLICITLY_SPECIFIED_TEST),$(MICROLITE_TEST_SRCS)),)
MICROLITE_TEST_SRCS := $(filter-out $(EXPLICITLY_SPECIFIED_TEST), $(MICROLITE_TEST_SRCS))
EXPLICITLY_SPECIFIED_TEST_SRCS := \
$(EXPLICITLY_SPECIFIED_TEST) \
tensorflow/lite/micro/benchmarks/keyword_scrambled_model_data.cc \
tensorflow/lite/micro/testing/test_conv_model.cc
EXPLICITLY_SPECIFIED_TEST_HDRS := \
tensorflow/lite/micro/benchmarks/keyword_scrambled_model_data.h \
tensorflow/lite/micro/testing/test_conv_model.h
$(eval $(call microlite_test,memory_arena_threshold_test,\
$(EXPLICITLY_SPECIFIED_TEST_SRCS),$(EXPLICITLY_SPECIFIED_TEST_HDRS)))
endif
EXPLICITLY_SPECIFIED_TEST:= tensorflow/lite/micro/micro_allocator_test.cc
ifneq ($(findstring $(EXPLICITLY_SPECIFIED_TEST),$(MICROLITE_TEST_SRCS)),)
MICROLITE_TEST_SRCS := $(filter-out $(EXPLICITLY_SPECIFIED_TEST), $(MICROLITE_TEST_SRCS))
EXPLICITLY_SPECIFIED_TEST_SRCS := \
$(EXPLICITLY_SPECIFIED_TEST) \
tensorflow/lite/micro/testing/test_conv_model.cc
EXPLICITLY_SPECIFIED_TEST_HDRS := \
tensorflow/lite/micro/testing/test_conv_model.h
$(eval $(call microlite_test,micro_allocator_test,\
$(EXPLICITLY_SPECIFIED_TEST_SRCS),$(EXPLICITLY_SPECIFIED_TEST_HDRS)))
endif
EXPLICITLY_SPECIFIED_TEST:= tensorflow/lite/micro/recording_micro_allocator_test.cc
ifneq ($(findstring $(EXPLICITLY_SPECIFIED_TEST),$(MICROLITE_TEST_SRCS)),)
MICROLITE_TEST_SRCS := $(filter-out $(EXPLICITLY_SPECIFIED_TEST), $(MICROLITE_TEST_SRCS))
EXPLICITLY_SPECIFIED_TEST_SRCS := \
$(EXPLICITLY_SPECIFIED_TEST) \
tensorflow/lite/micro/testing/test_conv_model.cc
EXPLICITLY_SPECIFIED_TEST_HDRS := \
tensorflow/lite/micro/testing/test_conv_model.h
$(eval $(call microlite_test,recording_micro_allocator_test,\
$(EXPLICITLY_SPECIFIED_TEST_SRCS),$(EXPLICITLY_SPECIFIED_TEST_HDRS)))
endif
# For all the tests that do not have any additional dependencies, we can
# add a make target in a common way.
$(foreach TEST_TARGET,$(filter-out tensorflow/lite/micro/kernels/%,$(MICROLITE_TEST_SRCS)),\
$(eval $(call microlite_test,$(notdir $(basename $(TEST_TARGET))),$(TEST_TARGET))))
$(foreach TEST_TARGET,$(filter tensorflow/lite/micro/kernels/%,$(MICROLITE_TEST_SRCS)),\
$(eval $(call microlite_test,kernel_$(notdir $(basename $(TEST_TARGET))),$(TEST_TARGET))))