diff --git a/tensorflow/lite/micro/kernels/batch_to_space_nd.cc b/tensorflow/lite/micro/kernels/batch_to_space_nd.cc index affddc39669..a6fa0462168 100644 --- a/tensorflow/lite/micro/kernels/batch_to_space_nd.cc +++ b/tensorflow/lite/micro/kernels/batch_to_space_nd.cc @@ -51,10 +51,6 @@ TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE(context, NumDimensions(output) <= kInputOutputMaxDimensionNum); TF_LITE_ENSURE_TYPES_EQ(context, input->type, output->type); - // Padding can result in a larger output than input. - TF_LITE_ENSURE(context, - ElementCount(*output->dims) >= ElementCount(*input->dims)); - return kTfLiteOk; } diff --git a/tensorflow/lite/micro/kernels/batch_to_space_nd_test.cc b/tensorflow/lite/micro/kernels/batch_to_space_nd_test.cc index 0903e79630c..2d195dd62e2 100644 --- a/tensorflow/lite/micro/kernels/batch_to_space_nd_test.cc +++ b/tensorflow/lite/micro/kernels/batch_to_space_nd_test.cc @@ -151,18 +151,4 @@ TF_LITE_MICRO_TEST(BatchToSpaceBasicInt8) { tflite::testing::basic_golden, golden_quantized, 1.0f, 0, output)); } -TF_LITE_MICRO_TEST(BatchToSpaceInvalidOutputDimensionShouldFail) { - constexpr int output_length = 12; - const int output_dims[] = {4, 1, 4, 3, 1}; - float output[output_length]; - TF_LITE_MICRO_EXPECT_EQ( - kTfLiteError, - tflite::testing::TestBatchToSpaceNdFloat( - tflite::testing::basic_input_dims, tflite::testing::basic_input, - tflite::testing::basic_block_shape_dims, - tflite::testing::basic_block_shape, tflite::testing::basic_crops_dims, - tflite::testing::basic_crops, output_dims, - tflite::testing::basic_golden, output)); -} - TF_LITE_MICRO_TESTS_END diff --git a/tensorflow/lite/micro/kernels/space_to_batch_nd.cc b/tensorflow/lite/micro/kernels/space_to_batch_nd.cc index 27eeef9efd1..fdfb81bcb91 100644 --- a/tensorflow/lite/micro/kernels/space_to_batch_nd.cc +++ b/tensorflow/lite/micro/kernels/space_to_batch_nd.cc @@ -57,10 +57,6 @@ TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE(context, NumDimensions(output) <= kInputOutputMaxDimensionNum); TF_LITE_ENSURE_TYPES_EQ(context, input->type, output->type); - // Padding can result in a larger output than input. - TF_LITE_ENSURE(context, - ElementCount(*output->dims) >= ElementCount(*input->dims)); - return kTfLiteOk; } diff --git a/tensorflow/lite/micro/kernels/space_to_batch_nd_test.cc b/tensorflow/lite/micro/kernels/space_to_batch_nd_test.cc index a5ab5536111..1d9d233d6d9 100644 --- a/tensorflow/lite/micro/kernels/space_to_batch_nd_test.cc +++ b/tensorflow/lite/micro/kernels/space_to_batch_nd_test.cc @@ -151,18 +151,4 @@ TF_LITE_MICRO_TEST(SpaceToBatchBasicInt8) { tflite::testing::basic_golden, golden_quantized, 1.0f, 0, output)); } -TF_LITE_MICRO_TEST(SpaceToBatchInvalidOutputDimensionShouldFail) { - constexpr int output_length = 12; - const int output_dims[] = {4, 1, 4, 3, 1}; - float output[output_length]; - TF_LITE_MICRO_EXPECT_EQ( - kTfLiteError, - tflite::testing::TestSpaceToBatchNdFloat( - tflite::testing::basic_input_dims, tflite::testing::basic_input, - tflite::testing::basic_block_shape_dims, - tflite::testing::basic_block_shape, tflite::testing::basic_crops_dims, - tflite::testing::basic_crops, output_dims, - tflite::testing::basic_golden, output)); -} - TF_LITE_MICRO_TESTS_END