From f8ed429b2552a38432f3295305967754011454cd Mon Sep 17 00:00:00 2001 From: rsun Date: Wed, 3 Feb 2021 11:50:57 -0800 Subject: [PATCH] Use the right input_dims[] in lite/micro/kernels/zeros_like_test.cc --- tensorflow/lite/micro/kernels/zeros_like_test.cc | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tensorflow/lite/micro/kernels/zeros_like_test.cc b/tensorflow/lite/micro/kernels/zeros_like_test.cc index 70b35f6771d..59f0ed98dc7 100644 --- a/tensorflow/lite/micro/kernels/zeros_like_test.cc +++ b/tensorflow/lite/micro/kernels/zeros_like_test.cc @@ -13,7 +13,6 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include #include "tensorflow/lite/c/builtin_op_data.h" #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/micro/all_ops_resolver.h" @@ -52,7 +51,6 @@ void TestZerosLikeFloat(const int* input_dims_data, const float* input_data, TF_LITE_MICRO_EXPECT_EQ(kTfLiteOk, runner.InitAndPrepare()); TF_LITE_MICRO_EXPECT_EQ(kTfLiteOk, runner.Invoke()); - micro_test::reporter->Report("output_dims_count: %d", output_dims_count); for (int i = 0; i < output_dims_count; ++i) { TF_LITE_MICRO_EXPECT_EQ(expected_output_data[i], output_data[i]); } @@ -130,29 +128,25 @@ TF_LITE_MICRO_TESTS_BEGIN TF_LITE_MICRO_TEST(TestZerosLikeFloat) { float output_data[6]; - const int input_dims[] = {1, 2, 3}; + const int input_dims[] = {2, 2, 3}; const float input_values[] = {-2.0, -1.0, 0.0, 1.0, 2.0, 3.0}; - - // HOW DID THIS PASS ?! - const float golden[] = {0.0, 0.0, 0.0, 125.0, 0.0, 0.0}; + const float golden[] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; tflite::testing::TestZerosLikeFloat(input_dims, input_values, golden, output_data); } TF_LITE_MICRO_TEST(TestZerosLikeInt32) { int32_t output_data[4]; - const int input_dims[] = {2, 2, 1}; + const int input_dims[] = {4, 1, 2, 2, 1}; const int32_t input_values[] = {-2, -1, 0, 3}; - - // HOW DID THIS PASS ?! - const int32_t golden[] = {0, 0, 65, 0}; + const int32_t golden[] = {0, 0, 0, 0}; tflite::testing::TestZerosLikeInt32(input_dims, input_values, golden, output_data); } TF_LITE_MICRO_TEST(TestZerosLikeInt64) { int64_t output_data[4]; - const int input_dims[] = {2, 2, 1}; + const int input_dims[] = {4, 1, 2, 2, 1}; const int64_t input_values[] = {-2, -1, 0, 3}; const int64_t golden[] = {0, 0, 0, 0}; tflite::testing::TestZerosLikeInt64(input_dims, input_values, golden,