未验证 提交 178fc021 编写于 作者: T Ting Yan 提交者: GitHub

Add float and hybrid tests for LSTM (#1092)

* Add float tests for LSTM

* Format test code properly

* Zero state and output buffers

* Add test for batch major input/ouput

* Add hybrid tests

* RISC-V build fails on std::round(), replace with round()

* Minor formatting changes suggested by comments

* Refactor tests to use test config structs

* Remove unused const variable

* Put test config data into separate source/header files

* Add bazel build file
上级 7becb7a3
......@@ -332,6 +332,13 @@ cc_library(
hdrs = ["micro_utils.h"],
)
cc_library(
name = "unidirectional_sequence_lstm_test_config",
srcs = ["unidirectional_sequence_lstm_test_config.cc"],
hdrs = ["unidirectional_sequence_lstm_test_config.h"],
deps = ["//tensorflow/lite/c:common"],
)
####################################
# C++ tests
####################################
......@@ -1293,6 +1300,7 @@ cc_test(
"//tensorflow/lite/micro:micro_utils",
"//tensorflow/lite/micro:op_resolvers",
"//tensorflow/lite/micro:test_helpers",
"//tensorflow/lite/micro/kernels:unidirectional_sequence_lstm_test_config",
"//tensorflow/lite/micro/testing:micro_test",
],
)
......
......@@ -38,6 +38,11 @@ $(eval $(call microlite_test,kernel_transpose_conv_test,\
tensorflow/lite/micro/kernels/conv_test_common.cc,\
tensorflow/lite/micro/kernels/conv_test.h))
$(eval $(call microlite_test,unidirectional_sequence_lstm_test,\
tensorflow/lite/micro/kernels/unidirectional_sequence_lstm_test.cc \
tensorflow/lite/micro/kernels/unidirectional_sequence_lstm_test_config.cc,\
tensorflow/lite/micro/kernels/unidirectional_sequence_lstm_test_config.h))
# For kernel tests without extra dependencies (beyond libtensorflow-microlite.a),
# use simple for loop to generate their make targets in a common way.
MICROLITE_KERNEL_SIMPLE_TEST_SRCS := \
......@@ -103,7 +108,6 @@ tensorflow/lite/micro/kernels/sub_test.cc \
tensorflow/lite/micro/kernels/svdf_test.cc \
tensorflow/lite/micro/kernels/tanh_test.cc \
tensorflow/lite/micro/kernels/transpose_test.cc \
tensorflow/lite/micro/kernels/unidirectional_sequence_lstm_test.cc \
tensorflow/lite/micro/kernels/unpack_test.cc \
tensorflow/lite/micro/kernels/while_test.cc \
tensorflow/lite/micro/kernels/zeros_like_test.cc
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册