diff --git a/tensorflow/lite/micro/kernels/broadcast_args_test.cc b/tensorflow/lite/micro/kernels/broadcast_args_test.cc index ff5f0bb9771..79a09be77bc 100644 --- a/tensorflow/lite/micro/kernels/broadcast_args_test.cc +++ b/tensorflow/lite/micro/kernels/broadcast_args_test.cc @@ -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}; diff --git a/tensorflow/lite/micro/kernels/reduce_test.cc b/tensorflow/lite/micro/kernels/reduce_test.cc index 76990e1388c..5c0e44f31f6 100644 --- a/tensorflow/lite/micro/kernels/reduce_test.cc +++ b/tensorflow/lite/micro/kernels/reduce_test.cc @@ -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]; diff --git a/tensorflow/lite/micro/kernels/reshape_test.cc b/tensorflow/lite/micro/kernels/reshape_test.cc index d78d9fa9124..f3d4265930c 100644 --- a/tensorflow/lite/micro/kernels/reshape_test.cc +++ b/tensorflow/lite/micro/kernels/reshape_test.cc @@ -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); @@ -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); @@ -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, @@ -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, @@ -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( &input_tensor, &shape_tensor, &output_tensor, expected_output_with_shape, diff --git a/tensorflow/lite/micro/kernels/strided_slice_test.cc b/tensorflow/lite/micro/kernels/strided_slice_test.cc index 5c799feff3b..07e92dc18b6 100644 --- a/tensorflow/lite/micro/kernels/strided_slice_test.cc +++ b/tensorflow/lite/micro/kernels/strided_slice_test.cc @@ -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 = {}; @@ -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 = {}; @@ -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}; @@ -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}; diff --git a/tensorflow/lite/micro/micro_resource_variable_test.cc b/tensorflow/lite/micro/micro_resource_variable_test.cc index fd8384873ea..d7e7518aeb7 100644 --- a/tensorflow/lite/micro/micro_resource_variable_test.cc +++ b/tensorflow/lite/micro/micro_resource_variable_test.cc @@ -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(golden)}, + {golden}, tflite::testing::IntArrayFromInts(dims), kTfLiteFloat32, }; @@ -126,7 +126,7 @@ TF_LITE_MICRO_TEST(VerifyAssignAndReadResourceBuffer) { int32_t buffer[32]; TfLiteEvalTensor read_tensor = { - {reinterpret_cast(buffer)}, + {buffer}, tflite::testing::IntArrayFromInts(dims), kTfLiteInt32, }; diff --git a/tensorflow/lite/micro/tools/BUILD b/tensorflow/lite/micro/tools/BUILD index 22bf93259d0..bcae7163bd1 100644 --- a/tensorflow/lite/micro/tools/BUILD +++ b/tensorflow/lite/micro/tools/BUILD @@ -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", @@ -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"), ], @@ -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", @@ -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", @@ -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"), @@ -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"),