fix build error in with makefiles in resize_nearest_neightbor_test.cc
PiperOrigin-RevId: 307634740 Change-Id: I00d1810c43d76ac0787557ead6098b6e68683db6
This commit is contained in:
parent
ffac1f3e0d
commit
8b9771cae3
|
@ -45,13 +45,11 @@ TfLiteTensor TestCreateTensor(const int8* data, TfLiteIntArray* dims,
|
|||
// Input data expects a 4-D tensor of [batch, height, width, channels]
|
||||
// Output data should match input datas batch and channels
|
||||
// Expected sizes should be a 1-D tensor with 2 elements: new_height & new_width
|
||||
template<typename T>
|
||||
void TestResizeNearestNeighbor(const int32* input_dims_data,
|
||||
const T* input_data,
|
||||
template <typename T>
|
||||
void TestResizeNearestNeighbor(const int* input_dims_data, const T* input_data,
|
||||
const int32* expected_size_data,
|
||||
const T* expected_output_data,
|
||||
const int32 *output_dims_data,
|
||||
T* output_data) {
|
||||
const int* output_dims_data, T* output_data) {
|
||||
TfLiteIntArray* input_dims = IntArrayFromInts(input_dims_data);
|
||||
|
||||
int expected_size_dims_data[] = {2, 1, 2};
|
||||
|
@ -113,73 +111,73 @@ void TestResizeNearestNeighbor(const int32* input_dims_data,
|
|||
TF_LITE_MICRO_TESTS_BEGIN
|
||||
|
||||
TF_LITE_MICRO_TEST(HorizontalResize) {
|
||||
const int32 input_dims[] = {4, 1, 1, 2, 1};
|
||||
const int input_dims[] = {4, 1, 1, 2, 1};
|
||||
const float input_data[] = {3, 6};
|
||||
const int32 expected_size_data[] = {1, 3};
|
||||
const float expected_output_data[] = {3, 3, 6};
|
||||
const int32 output_dims[] = {4, 1, 1, 3, 1};
|
||||
const int output_dims[] = {4, 1, 1, 3, 1};
|
||||
float output_data[3];
|
||||
|
||||
tflite::testing::TestResizeNearestNeighbor<float>(input_dims, input_data,
|
||||
expected_size_data, expected_output_data, output_dims, output_data);
|
||||
}
|
||||
TF_LITE_MICRO_TEST(HorizontalResizeUInt8) {
|
||||
const int32 input_dims[] = {4, 1, 1, 2, 1};
|
||||
const int input_dims[] = {4, 1, 1, 2, 1};
|
||||
const uint8 input_data[] = {3, 6};
|
||||
const int32 expected_size_data[] = {1, 3};
|
||||
const uint8 expected_output_data[] = {3, 3, 6};
|
||||
const int32 output_dims[] = {4, 1, 1, 3, 1};
|
||||
const int output_dims[] = {4, 1, 1, 3, 1};
|
||||
uint8 output_data[3];
|
||||
|
||||
tflite::testing::TestResizeNearestNeighbor<uint8>(input_dims, input_data,
|
||||
expected_size_data, expected_output_data, output_dims, output_data);
|
||||
}
|
||||
TF_LITE_MICRO_TEST(HorizontalResizeInt8) {
|
||||
const int32 input_dims[] = {4, 1, 1, 2, 1};
|
||||
const int input_dims[] = {4, 1, 1, 2, 1};
|
||||
const int8 input_data[] = {-3, 6};
|
||||
const int32 expected_size_data[] = {1, 3};
|
||||
const int8 expected_output_data[] = {-3, -3, 6};
|
||||
const int32 output_dims[] = {4, 1, 1, 3, 1};
|
||||
const int output_dims[] = {4, 1, 1, 3, 1};
|
||||
int8 output_data[3];
|
||||
|
||||
tflite::testing::TestResizeNearestNeighbor<int8>(input_dims, input_data,
|
||||
expected_size_data, expected_output_data, output_dims, output_data);
|
||||
}
|
||||
TF_LITE_MICRO_TEST(VerticalResize) {
|
||||
const int32 input_dims[] = {4, 1, 2, 1, 1};
|
||||
const int input_dims[] = {4, 1, 2, 1, 1};
|
||||
const float input_data[] = {3, 9};
|
||||
const int32 expected_size_data[] = {3, 1};
|
||||
const float expected_output_data[] = {3, 3, 9};
|
||||
const int32 output_dims[] = {4, 1, 3, 1, 1};
|
||||
const int output_dims[] = {4, 1, 3, 1, 1};
|
||||
float output_data[3];
|
||||
|
||||
tflite::testing::TestResizeNearestNeighbor<float>(input_dims, input_data,
|
||||
expected_size_data, expected_output_data, output_dims, output_data);
|
||||
}
|
||||
TF_LITE_MICRO_TEST(VerticalResizeUInt8) {
|
||||
const int32 input_dims[] = {4, 1, 2, 1, 1};
|
||||
const int input_dims[] = {4, 1, 2, 1, 1};
|
||||
const uint8 input_data[] = {3, 9};
|
||||
const int32 expected_size_data[] = {3, 1};
|
||||
const uint8 expected_output_data[] = {3, 3, 9};
|
||||
const int32 output_dims[] = {4, 1, 3, 1, 1};
|
||||
const int output_dims[] = {4, 1, 3, 1, 1};
|
||||
uint8 output_data[3];
|
||||
|
||||
tflite::testing::TestResizeNearestNeighbor<uint8>(input_dims, input_data,
|
||||
expected_size_data, expected_output_data, output_dims, output_data);
|
||||
}
|
||||
TF_LITE_MICRO_TEST(VerticalResizeInt8) {
|
||||
const int32 input_dims[] = {4, 1, 2, 1, 1};
|
||||
const int input_dims[] = {4, 1, 2, 1, 1};
|
||||
const int8 input_data[] = {3, -9};
|
||||
const int32 expected_size_data[] = {3, 1};
|
||||
const int8 expected_output_data[] = {3, 3, -9};
|
||||
const int32 output_dims[] = {4, 1, 3, 1, 1};
|
||||
const int output_dims[] = {4, 1, 3, 1, 1};
|
||||
int8 output_data[3];
|
||||
|
||||
tflite::testing::TestResizeNearestNeighbor<int8>(input_dims, input_data,
|
||||
expected_size_data, expected_output_data, output_dims, output_data);
|
||||
}
|
||||
TF_LITE_MICRO_TEST(TwoDimensionalResize) {
|
||||
const int32 input_dims[] = {4, 1, 2, 2, 1};
|
||||
const int input_dims[] = {4, 1, 2, 2, 1};
|
||||
const float input_data[] = {3, 6, //
|
||||
9, 12, //
|
||||
};
|
||||
|
@ -189,7 +187,7 @@ TF_LITE_MICRO_TEST(TwoDimensionalResize) {
|
|||
9, 9, 12 //
|
||||
};
|
||||
|
||||
const int32 output_dims[] = {4, 1, 3, 3, 1};
|
||||
const int output_dims[] = {4, 1, 3, 3, 1};
|
||||
float output_data[9];
|
||||
|
||||
tflite::testing::TestResizeNearestNeighbor<float>(input_dims, input_data,
|
||||
|
@ -205,14 +203,14 @@ TF_LITE_MICRO_TEST(TwoDimensionalResizeUInt8) {
|
|||
3, 3, 6, //
|
||||
9, 9, 12 //
|
||||
};
|
||||
const int32 output_dims[] = {4, 1, 3, 3, 1};
|
||||
const int output_dims[] = {4, 1, 3, 3, 1};
|
||||
uint8 output_data[9];
|
||||
|
||||
tflite::testing::TestResizeNearestNeighbor<uint8>(input_dims, input_data,
|
||||
expected_size_data, expected_output_data, output_dims, output_data);
|
||||
}
|
||||
TF_LITE_MICRO_TEST(TwoDimensionalResizeInt8) {
|
||||
const int32 input_dims[] = {4, 1, 2, 2, 1};
|
||||
const int input_dims[] = {4, 1, 2, 2, 1};
|
||||
const int8 input_data[] = {3, -6, //
|
||||
9, 12, //
|
||||
};
|
||||
|
@ -221,14 +219,14 @@ TF_LITE_MICRO_TEST(TwoDimensionalResizeInt8) {
|
|||
3, 3, -6, //
|
||||
9, 9, 12, //
|
||||
};
|
||||
const int32 output_dims[] = {4, 1, 3, 3, 1};
|
||||
const int output_dims[] = {4, 1, 3, 3, 1};
|
||||
int8 output_data[9];
|
||||
|
||||
tflite::testing::TestResizeNearestNeighbor<int8>(input_dims, input_data,
|
||||
expected_size_data, expected_output_data, output_dims, output_data);
|
||||
}
|
||||
TF_LITE_MICRO_TEST(TwoDimensionalResizeWithTwoBatches) {
|
||||
const int32 input_dims[] = {4, 2, 2, 2, 1};
|
||||
const int input_dims[] = {4, 2, 2, 2, 1};
|
||||
const float input_data[] = {3, 6, //
|
||||
9, 12, //
|
||||
4, 10, //
|
||||
|
@ -242,14 +240,14 @@ TF_LITE_MICRO_TEST(TwoDimensionalResizeWithTwoBatches) {
|
|||
4, 4, 10, //
|
||||
10, 10, 16, //
|
||||
};
|
||||
const int32 output_dims[] = {4, 2, 3, 3, 1};
|
||||
const int output_dims[] = {4, 2, 3, 3, 1};
|
||||
float output_data[18];
|
||||
|
||||
tflite::testing::TestResizeNearestNeighbor<float>(input_dims, input_data,
|
||||
expected_size_data, expected_output_data, output_dims, output_data);
|
||||
}
|
||||
TF_LITE_MICRO_TEST(TwoDimensionalResizeWithTwoBatchesUInt8) {
|
||||
const int32 input_dims[] = {4, 2, 2, 2, 1};
|
||||
const int input_dims[] = {4, 2, 2, 2, 1};
|
||||
const uint8 input_data[] = {3, 6, //
|
||||
9, 12, //
|
||||
4, 10, //
|
||||
|
@ -263,14 +261,14 @@ TF_LITE_MICRO_TEST(TwoDimensionalResizeWithTwoBatchesUInt8) {
|
|||
4, 4, 10, //
|
||||
10, 10, 16, //
|
||||
};
|
||||
const int32 output_dims[] = {4, 2, 3, 3, 1};
|
||||
const int output_dims[] = {4, 2, 3, 3, 1};
|
||||
uint8 output_data[18];
|
||||
|
||||
tflite::testing::TestResizeNearestNeighbor<uint8>(input_dims, input_data,
|
||||
expected_size_data, expected_output_data, output_dims, output_data);
|
||||
}
|
||||
TF_LITE_MICRO_TEST(TwoDimensionalResizeWithTwoBatchesInt8) {
|
||||
const int32 input_dims[] = {4, 2, 2, 2, 1};
|
||||
const int input_dims[] = {4, 2, 2, 2, 1};
|
||||
const int8 input_data[] = {3, 6, //
|
||||
9, -12, //
|
||||
-4, 10, //
|
||||
|
@ -284,7 +282,7 @@ TF_LITE_MICRO_TEST(TwoDimensionalResizeWithTwoBatchesInt8) {
|
|||
-4, -4, 10, //
|
||||
10, 10, 16, //
|
||||
};
|
||||
const int32 output_dims[] = {4, 2, 3, 3, 1};
|
||||
const int output_dims[] = {4, 2, 3, 3, 1};
|
||||
int8 output_data[18];
|
||||
|
||||
tflite::testing::TestResizeNearestNeighbor<int8>(input_dims, input_data,
|
||||
|
@ -300,14 +298,14 @@ TF_LITE_MICRO_TEST(ThreeDimensionalResize) {
|
|||
3, 4, 3, 4, 6, 10, //
|
||||
9, 10, 9, 10, 12, 16, //
|
||||
};
|
||||
const int32 output_dims[] = {4, 1, 3, 3, 2};
|
||||
const int output_dims[] = {4, 1, 3, 3, 2};
|
||||
float output_data[18];
|
||||
|
||||
tflite::testing::TestResizeNearestNeighbor<float>(input_dims, input_data,
|
||||
expected_size_data, expected_output_data, output_dims, output_data);
|
||||
}
|
||||
TF_LITE_MICRO_TEST(ThreeDimensionalResizeUInt8) {
|
||||
const int32 input_dims[] = {4, 1, 2, 2, 2};
|
||||
const int input_dims[] = {4, 1, 2, 2, 2};
|
||||
const uint8 input_data[] = {3, 4, 6, 10, //
|
||||
10, 12, 14, 16, //
|
||||
};
|
||||
|
@ -316,14 +314,14 @@ TF_LITE_MICRO_TEST(ThreeDimensionalResizeUInt8) {
|
|||
3, 4, 3, 4, 6, 10, //
|
||||
10, 12, 10, 12, 14, 16, //
|
||||
};
|
||||
const int32 output_dims[] = {4, 1, 3, 3, 2};
|
||||
const int output_dims[] = {4, 1, 3, 3, 2};
|
||||
uint8 output_data[18];
|
||||
|
||||
tflite::testing::TestResizeNearestNeighbor<uint8>(input_dims, input_data,
|
||||
expected_size_data, expected_output_data, output_dims, output_data);
|
||||
}
|
||||
TF_LITE_MICRO_TEST(ThreeDimensionalResizeInt8) {
|
||||
const int32 input_dims[] = {4, 1, 2, 2, 2};
|
||||
const int input_dims[] = {4, 1, 2, 2, 2};
|
||||
const int8 input_data[] = {3, 4, -6, 10, //
|
||||
10, 12, -14, 16, //
|
||||
};
|
||||
|
@ -332,7 +330,7 @@ TF_LITE_MICRO_TEST(ThreeDimensionalResizeInt8) {
|
|||
3, 4, 3, 4, -6, 10, //
|
||||
10, 12, 10, 12, -14, 16, //
|
||||
};
|
||||
const int32 output_dims[] = {4, 1, 3, 3, 2};
|
||||
const int output_dims[] = {4, 1, 3, 3, 2};
|
||||
int8 output_data[18];
|
||||
|
||||
tflite::testing::TestResizeNearestNeighbor<int8>(input_dims, input_data,
|
||||
|
|
Loading…
Reference in New Issue