Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tensorflow/lite/micro/kernels/broadcast_args_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ TF_LITE_MICRO_TESTS_BEGIN

TF_LITE_MICRO_TEST(BroadcastArgsWithScalar) {
int input1_shape[] = {1, 0};
int32_t input1_data[] = {};
int32_t input1_data[] = {0};

int input2_shape[] = {1, 2};
int32_t input2_data[2] = {2, 4};
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/lite/micro/kernels/reduce_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ TF_LITE_MICRO_TEST(SumFloatScalar) {
int input_shape[] = {1, 1};
int output_shape[] = {1, 1};
int axis_shape[] = {1, 0};
int32_t axis_data[] = {};
int32_t axis_data[] = {0};
float input_data[] = {1.0};
float expected_output[] = {1.0};
float actual_output_data[1];
Expand Down
20 changes: 10 additions & 10 deletions tensorflow/lite/micro/kernels/reshape_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ TF_LITE_MICRO_TEST(ReshapeWithMismatchedDimensionsShouldFail) {
const int32_t shape_int32[] = {2, 1};
int output_dims[] = {2, 2, 1};
const int golden_output_len = 0;
const float golden_output[] = {};
const float golden_output[] = {0.0f};
const int golden_dims_len = 0;
int golden_dims[] = {};
int golden_dims[] = {0};
tflite::testing::TestReshape(
input_dims, input_data, shape_dims, shape_int32, output_dims, output_data,
golden_output, golden_output_len, golden_dims, golden_dims_len, true);
Expand Down Expand Up @@ -197,9 +197,9 @@ TF_LITE_MICRO_TEST(ReshapeWithTooManySpecialDimensionsShouldFail) {
const int32_t shape_int32[] = {-1, -1, 2, 4};
int output_dims[] = {4, -1, -1, 2, 4};
const int golden_output_len = 2;
const float golden_output[] = {};
const float golden_output[] = {0.0f};
const int golden_dims_len = 9;
int golden_dims[] = {};
int golden_dims[] = {0};
tflite::testing::TestReshape(
input_dims, input, shape_dims, shape_int32, output_dims, output_data,
golden_output, golden_output_len, golden_dims, golden_dims_len, true);
Expand All @@ -218,9 +218,9 @@ TF_LITE_MICRO_TEST(ReshapeWithInvalidShapeShouldFail) {
TfLiteIntArray* output_dims =
tflite::testing::IntArrayFromInts(output_dims_data);
auto output_tensor = tflite::testing::CreateTensor(output_data, output_dims);
const int expected_output[] = {};
const int expected_output[] = {0};
const int expected_output_len = 0;
int expected_dims[] = {};
int expected_dims[] = {0};
const int expected_dims_len = 0;
tflite::testing::TestReshapeWithoutShape(
&input_tensor, &output_tensor, expected_output, expected_output_len,
Expand Down Expand Up @@ -314,14 +314,14 @@ TF_LITE_MICRO_TEST(ReshapeWithScalarOutputShouldSucceed) {
const int8_t input_int8[] = {3};
const uint8_t input_uint8[] = {3};
int shape_dims[] = {0};
const int32_t shape_int32[] = {};
const int32_t shape_int32[] = {0};
int output_dims[] = {0};
const int golden_output_len = 1;
const float golden_output_float[] = {3};
const int8_t golden_output_int8[] = {3};
const uint8_t golden_output_uint8[] = {3};
const int golden_dims_len = 0;
int golden_dims[] = {};
int golden_dims[] = {0};
tflite::testing::TestReshape(input_dims, input_float, shape_dims, shape_int32,
output_dims, output_data_float,
golden_output_float, golden_output_len,
Expand Down Expand Up @@ -357,11 +357,11 @@ TF_LITE_MICRO_TEST(ReshapeWithLegacyScalarOutputShouldSucceed) {

const int32_t shape_data[] = {0};
auto shape_tensor = tflite::testing::CreateTensor(shape_data, shape_dims);
const float expected_output_with_shape[] = {};
const float expected_output_with_shape[] = {0.0f};
const int expected_output_with_shape_len = 0;
const float expected_output_no_shape[] = {3};
const int expected_output_no_shape_len = 1;
int expected_dims[] = {};
int expected_dims[] = {0};
const int expected_dims_len = 0;
tflite::testing::TestReshapeWithShape<float>(
&input_tensor, &shape_tensor, &output_tensor, expected_output_with_shape,
Expand Down
18 changes: 9 additions & 9 deletions tensorflow/lite/micro/kernels/strided_slice_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ TF_LITE_MICRO_TEST(UnsupportedInputSize) {
int end_shape[] = {1, 5};
int strides_shape[] = {1, 5};
int output_shape[] = {0};
float input_data[] = {};
int32_t begin_data[] = {};
int32_t end_data[] = {};
int32_t strides_data[] = {};
float golden[] = {};
float input_data[] = {0.0f};
int32_t begin_data[] = {0};
int32_t end_data[] = {0};
int32_t strides_data[] = {0};
float golden[] = {0.0f};
float output_data[4];

TfLiteStridedSliceParams builtin_data = {};
Expand Down Expand Up @@ -195,7 +195,7 @@ TF_LITE_MICRO_TEST(In1D_EmptyOutput) {
int32_t begin_data[] = {10};
int32_t end_data[] = {3};
int32_t strides_data[] = {1};
float golden[] = {};
float golden[] = {0.0f};
float output_data[4];

TfLiteStridedSliceParams builtin_data = {};
Expand Down Expand Up @@ -1243,7 +1243,7 @@ TF_LITE_MICRO_TEST(StrideOutOfBounds) {
int end_shape[] = {1, 1};
int strides_shape[] = {1, 1};
int output_shape[] = {0};
float input_data[] = {};
float input_data[] = {0.0f};
int32_t begin_data[] = {1};
int32_t end_data[] = {4};
int32_t strides_data[] = {7};
Expand All @@ -1264,11 +1264,11 @@ TF_LITE_MICRO_TEST(OutOfBounds) {
int end_shape[] = {1, 1};
int strides_shape[] = {1, 1};
int output_shape[] = {0};
float input_data[] = {};
float input_data[] = {0.0f};
int32_t begin_data[] = {1};
int32_t end_data[] = {2};
int32_t strides_data[] = {1};
float golden[0];
float golden[] = {0.0f};
float output_data[16];

TfLiteStridedSliceParams builtin_data = {0, 0, 0, 0, 1, false};
Expand Down
4 changes: 2 additions & 2 deletions tensorflow/lite/micro/micro_resource_variable_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ TF_LITE_MICRO_TEST(VerifyAssignAndReadResourceBuffer) {
23, 24, 25, 26, 27, 28, 29, 30, 31, 32};
int dims[] = {1, 32};
TfLiteEvalTensor assign_tensor = {
{reinterpret_cast<float*>(golden)},
{golden},
tflite::testing::IntArrayFromInts(dims),
kTfLiteFloat32,
};
Expand All @@ -126,7 +126,7 @@ TF_LITE_MICRO_TEST(VerifyAssignAndReadResourceBuffer) {

int32_t buffer[32];
TfLiteEvalTensor read_tensor = {
{reinterpret_cast<float*>(buffer)},
{buffer},
tflite::testing::IntArrayFromInts(dims),
kTfLiteInt32,
};
Expand Down
24 changes: 24 additions & 0 deletions tensorflow/lite/micro/tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ pybind_extension(
srcs = [
"tflite_flatbuffer_align_wrapper.cc",
],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
deps = [
"//tensorflow/lite/schema:schema_fbs",
"@flatbuffers",
Expand All @@ -96,6 +100,10 @@ py_binary(
data = [
":tflite_flatbuffer_align_wrapper.so",
],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
deps = [
requirement("absl_py"),
],
Expand All @@ -107,6 +115,10 @@ py_library(
data = [
":tflite_flatbuffer_align_wrapper.so",
],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
visibility = [
":application_friends",
":tflm_tools",
Expand All @@ -123,6 +135,10 @@ py_library(
data = [
":tflite_flatbuffer_align",
],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
visibility = [
":application_friends",
":tflm_tools",
Expand Down Expand Up @@ -163,6 +179,10 @@ cc_binary(
py_binary(
name = "tflm_model_transforms",
srcs = ["tflm_model_transforms.py"],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
deps = [
":tflm_model_transforms_lib",
requirement("absl_py"),
Expand All @@ -181,6 +201,10 @@ py_test(
"nomsan",
"noubsan",
],
target_compatible_with = select({
"@bazel_tools//src/conditions:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
deps = [
":tflm_model_transforms_lib",
requirement("absl_py"),
Expand Down
Loading