From 9bbc41c55433cbd7749ad50a2882fe07c2babf63 Mon Sep 17 00:00:00 2001 From: Elena Zhelezina Date: Wed, 11 Sep 2019 12:06:23 +0100 Subject: [PATCH] 16-bit support for reference kernels: MAX/MIN element-wise reference operators PACK UNPACK --- tensorflow/lite/kernels/maximum_minimum.cc | 3 + .../lite/kernels/maximum_minimum_test.cc | 11 + tensorflow/lite/kernels/pack.cc | 4 + tensorflow/lite/kernels/pack_test.cc | 75 ++--- tensorflow/lite/kernels/unpack.cc | 6 +- tensorflow/lite/kernels/unpack_test.cc | 262 +++++------------- 6 files changed, 110 insertions(+), 251 deletions(-) diff --git a/tensorflow/lite/kernels/maximum_minimum.cc b/tensorflow/lite/kernels/maximum_minimum.cc index c51d7d07aff..29ac306311b 100644 --- a/tensorflow/lite/kernels/maximum_minimum.cc +++ b/tensorflow/lite/kernels/maximum_minimum.cc @@ -119,6 +119,9 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { case kTfLiteInt64: TFLiteOperation(context, node, op_context); break; + case kTfLiteInt16: + TFLiteOperation(context, node, op_context); + break; default: context->ReportError(context, "Type %d is currently not supported by Maximum.", diff --git a/tensorflow/lite/kernels/maximum_minimum_test.cc b/tensorflow/lite/kernels/maximum_minimum_test.cc index 669135bcf51..b421dd3b3ea 100644 --- a/tensorflow/lite/kernels/maximum_minimum_test.cc +++ b/tensorflow/lite/kernels/maximum_minimum_test.cc @@ -123,6 +123,17 @@ TEST(MaxMinOpTest, Int8Test) { data1, data2, {0, 0, 1, 11, 2, 1}); } +TEST(MaxMinOpTest, Int16Test) { + std::initializer_list data1 = {-32768, 0, 2, 11, 2, 23}; + std::initializer_list data2 = {0, 0, 1, 32767, 123, 1}; + TestModel(BuiltinOperator_MAXIMUM, {TensorType_INT16, {3, 1, 2}}, + {TensorType_INT16, {3, 1, 2}}, {TensorType_INT16, {3, 1, 2}}, + data1, data2, {0, 0, 2, 32767, 123, 23}); + TestModel(BuiltinOperator_MINIMUM, {TensorType_INT16, {3, 1, 2}}, + {TensorType_INT16, {3, 1, 2}}, {TensorType_INT16, {3, 1, 2}}, + data1, data2, {-32768, 0, 1, 11, 2, 1}); +} + TEST(MaximumOpTest, FloatWithBroadcastTest) { std::initializer_list data1 = {1.0, 0.0, -1.0, -2.0, -1.44, 11.0}; std::initializer_list data2 = {0.5, 2.0}; diff --git a/tensorflow/lite/kernels/pack.cc b/tensorflow/lite/kernels/pack.cc index 8e30dce8009..ebc3381dae8 100644 --- a/tensorflow/lite/kernels/pack.cc +++ b/tensorflow/lite/kernels/pack.cc @@ -116,6 +116,10 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { return PackImpl(context, node, output, data->values_count, data->axis); } + case kTfLiteInt16: { + return PackImpl(context, node, output, data->values_count, + data->axis); + } case kTfLiteInt32: { return PackImpl(context, node, output, data->values_count, data->axis); diff --git a/tensorflow/lite/kernels/pack_test.cc b/tensorflow/lite/kernels/pack_test.cc index 9b181e465cf..7d18bb6c34f 100644 --- a/tensorflow/lite/kernels/pack_test.cc +++ b/tensorflow/lite/kernels/pack_test.cc @@ -191,9 +191,22 @@ TEST(PackOpTest, Int64MultilDimensions) { 4LL, 5LL, 6LL, 10LL, 11LL, 12LL})); } -// uint8 -TEST(PackOpTest, Uint8ThreeInputs) { - PackOpModel model({TensorType_UINT8, {2}}, 0, 3); +template +struct PackOpTestInt : public ::testing::Test { + using TypeToTest = InputType; + TensorType TENSOR_TYPE = + std::is_same::value + ? TensorType_INT16 + : (std::is_same::value ? TensorType_UINT8 + : TensorType_INT8); +}; + +using TestTypes = testing::Types; +TYPED_TEST_CASE(PackOpTestInt, TestTypes); + +TYPED_TEST(PackOpTestInt, ThreeInputs) { + PackOpModel model( + {TestFixture::TENSOR_TYPE, {2}}, 0, 3); model.SetInput(0, {1, 4}); model.SetInput(1, {2, 5}); model.SetInput(2, {3, 6}); @@ -202,8 +215,9 @@ TEST(PackOpTest, Uint8ThreeInputs) { EXPECT_THAT(model.GetOutput(), ElementsAreArray({1, 4, 2, 5, 3, 6})); } -TEST(PackOpTest, Uint8ThreeInputsDifferentAxis) { - PackOpModel model({TensorType_UINT8, {2}}, 1, 3); +TYPED_TEST(PackOpTestInt, ThreeInputsDifferentAxis) { + PackOpModel model( + {TestFixture::TENSOR_TYPE, {2}}, 1, 3); model.SetInput(0, {1, 4}); model.SetInput(1, {2, 5}); model.SetInput(2, {3, 6}); @@ -212,8 +226,9 @@ TEST(PackOpTest, Uint8ThreeInputsDifferentAxis) { EXPECT_THAT(model.GetOutput(), ElementsAreArray({1, 2, 3, 4, 5, 6})); } -TEST(PackOpTest, Uint8ThreeInputsNegativeAxis) { - PackOpModel model({TensorType_UINT8, {2}}, -1, 3); +TYPED_TEST(PackOpTestInt, ThreeInputsNegativeAxis) { + PackOpModel model( + {TestFixture::TENSOR_TYPE, {2}}, -1, 3); model.SetInput(0, {1, 4}); model.SetInput(1, {2, 5}); model.SetInput(2, {3, 6}); @@ -222,49 +237,9 @@ TEST(PackOpTest, Uint8ThreeInputsNegativeAxis) { EXPECT_THAT(model.GetOutput(), ElementsAreArray({1, 2, 3, 4, 5, 6})); } -TEST(PackOpTest, Uint8MultilDimensions) { - PackOpModel model({TensorType_UINT8, {2, 3}}, 1, 2); - model.SetInput(0, {1, 2, 3, 4, 5, 6}); - model.SetInput(1, {7, 8, 9, 10, 11, 12}); - model.Invoke(); - EXPECT_THAT(model.GetOutputShape(), ElementsAre(2, 2, 3)); - EXPECT_THAT(model.GetOutput(), - ElementsAreArray({1, 2, 3, 7, 8, 9, 4, 5, 6, 10, 11, 12})); -} - -// int8 -TEST(PackOpTest, Int8ThreeInputs) { - PackOpModel model({TensorType_INT8, {2}}, 0, 3); - model.SetInput(0, {1, 4}); - model.SetInput(1, {2, 5}); - model.SetInput(2, {3, 6}); - model.Invoke(); - EXPECT_THAT(model.GetOutputShape(), ElementsAre(3, 2)); - EXPECT_THAT(model.GetOutput(), ElementsAreArray({1, 4, 2, 5, 3, 6})); -} - -TEST(PackOpTest, Int8ThreeInputsDifferentAxis) { - PackOpModel model({TensorType_INT8, {2}}, 1, 3); - model.SetInput(0, {1, 4}); - model.SetInput(1, {2, 5}); - model.SetInput(2, {3, 6}); - model.Invoke(); - EXPECT_THAT(model.GetOutputShape(), ElementsAre(2, 3)); - EXPECT_THAT(model.GetOutput(), ElementsAreArray({1, 2, 3, 4, 5, 6})); -} - -TEST(PackOpTest, Int8ThreeInputsNegativeAxis) { - PackOpModel model({TensorType_INT8, {2}}, -1, 3); - model.SetInput(0, {1, 4}); - model.SetInput(1, {2, 5}); - model.SetInput(2, {3, 6}); - model.Invoke(); - EXPECT_THAT(model.GetOutputShape(), ElementsAre(2, 3)); - EXPECT_THAT(model.GetOutput(), ElementsAreArray({1, 2, 3, 4, 5, 6})); -} - -TEST(PackOpTest, Int8MultilDimensions) { - PackOpModel model({TensorType_INT8, {2, 3}}, 1, 2); +TYPED_TEST(PackOpTestInt, MultilDimensions) { + PackOpModel model( + {TestFixture::TENSOR_TYPE, {2, 3}}, 1, 2); model.SetInput(0, {1, 2, 3, 4, 5, 6}); model.SetInput(1, {7, 8, 9, 10, 11, 12}); model.Invoke(); diff --git a/tensorflow/lite/kernels/unpack.cc b/tensorflow/lite/kernels/unpack.cc index 8e66432e9cd..ebbc5e6472c 100644 --- a/tensorflow/lite/kernels/unpack.cc +++ b/tensorflow/lite/kernels/unpack.cc @@ -44,7 +44,7 @@ TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE(context, 0 <= axis && axis < NumDimensions(input)); if (input->type != kTfLiteInt32 && input->type != kTfLiteFloat32 && input->type != kTfLiteUInt8 && input->type != kTfLiteInt8 && - input->type != kTfLiteBool) { + input->type != kTfLiteInt16 && input->type != kTfLiteBool) { context->ReportError(context, "Type '%s' is not supported by unpack.", TfLiteTypeGetName(input->type)); return kTfLiteError; @@ -117,6 +117,10 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { UnpackImpl(context, node, input, data->num, data->axis); break; } + case kTfLiteInt16: { + UnpackImpl(context, node, input, data->num, data->axis); + break; + } default: { context->ReportError(context, "Type '%s' is not supported by unpack.", TfLiteTypeGetName(input->type)); diff --git a/tensorflow/lite/kernels/unpack_test.cc b/tensorflow/lite/kernels/unpack_test.cc index 88eb706e969..40fb0597893 100644 --- a/tensorflow/lite/kernels/unpack_test.cc +++ b/tensorflow/lite/kernels/unpack_test.cc @@ -83,213 +83,75 @@ void Check(int axis, const std::initializer_list& input_shape, EXPECT_THAT(m.GetOutputDatas(), ElementsAreArray(exp_output_data)); } -// float32 tests. -TEST(UnpackOpTest, FloatThreeOutputs) { - Check(/*axis=*/0, /*input_shape=*/{3, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{2}, {2}, {2}}, - /*exp_output_data=*/{{1, 2}, {3, 4}, {5, 6}}); +template +struct UnpackOpTest : public ::testing::Test { + using TypeToTest = InputType; + TensorType TENSOR_TYPE = + std::is_same::value + ? TensorType_INT16 + : std::is_same::value + ? TensorType_UINT8 + : std::is_same::value + ? TensorType_INT8 + : std::is_same::value + ? TensorType_INT32 + : TensorType_FLOAT32; +}; + +using TestTypes = testing::Types; +TYPED_TEST_CASE(UnpackOpTest, TestTypes); + +TYPED_TEST(UnpackOpTest, ThreeOutputs) { + Check( + /*axis=*/0, /*input_shape=*/{3, 2}, + /*input_data=*/{1, 2, 3, 4, 5, 6}, + /*exp_output_shape=*/{{2}, {2}, {2}}, + /*exp_output_data=*/{{1, 2}, {3, 4}, {5, 6}}, TestFixture::TENSOR_TYPE); } -TEST(UnpackOpTest, FloatThreeOutputsAxisOne) { - Check(/*axis=*/1, /*input_shape=*/{3, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{3}, {3}}, - /*exp_output_data=*/{{1, 3, 5}, {2, 4, 6}}); +TYPED_TEST(UnpackOpTest, ThreeOutputsAxisOne) { + Check( + /*axis=*/1, /*input_shape=*/{3, 2}, + /*input_data=*/{1, 2, 3, 4, 5, 6}, + /*exp_output_shape=*/{{3}, {3}}, + /*exp_output_data=*/{{1, 3, 5}, {2, 4, 6}}, TestFixture::TENSOR_TYPE); } -TEST(UnpackOpTest, FloatThreeOutputsNegativeAxisOne) { - Check(/*axis=*/-1, /*input_shape=*/{3, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{3}, {3}}, - /*exp_output_data=*/{{1, 3, 5}, {2, 4, 6}}); +TYPED_TEST(UnpackOpTest, ThreeOutputsNegativeAxisOne) { + Check( + /*axis=*/-1, /*input_shape=*/{3, 2}, + /*input_data=*/{1, 2, 3, 4, 5, 6}, + /*exp_output_shape=*/{{3}, {3}}, + /*exp_output_data=*/{{1, 3, 5}, {2, 4, 6}}, TestFixture::TENSOR_TYPE); } -TEST(UnpackOpTest, FloatThreeOutputsNegativeAxisTwo) { - Check(/*axis=*/-2, /*input_shape=*/{3, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{2}, {2}, {2}}, - /*exp_output_data=*/{{1, 2}, {3, 4}, {5, 6}}); +TYPED_TEST(UnpackOpTest, OneOutput) { + Check( + /*axis=*/0, /*input_shape=*/{1, 6}, + /*input_data=*/{1, 2, 3, 4, 5, 6}, + /*exp_output_shape=*/{{6}}, + /*exp_output_data=*/{{1, 2, 3, 4, 5, 6}}, TestFixture::TENSOR_TYPE); } -TEST(UnpackOpTest, FloatOneOutput) { - Check(/*axis=*/0, /*input_shape=*/{1, 6}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{6}}, - /*exp_output_data=*/{{1, 2, 3, 4, 5, 6}}); +TYPED_TEST(UnpackOpTest, ThreeDimensionsOutputs) { + Check( + /*axis=*/2, /*input_shape=*/{2, 2, 2}, + /*input_data=*/{1, 2, 3, 4, 5, 6, 7, 8}, + /*exp_output_shape=*/{{2, 2}, {2, 2}}, + /*exp_output_data=*/{{1, 3, 5, 7}, {2, 4, 6, 8}}, + TestFixture::TENSOR_TYPE); } -TEST(UnpackOpTest, FloatThreeDimensionsOutputs) { - Check(/*axis=*/2, /*input_shape=*/{2, 2, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6, 7, 8}, - /*exp_output_shape=*/{{2, 2}, {2, 2}}, - /*exp_output_data=*/{{1, 3, 5, 7}, {2, 4, 6, 8}}); -} - -TEST(UnpackOpTest, FloatVectorToScalar) { - Check(/*axis=*/0, /*input_shape=*/{5}, - /*input_data=*/{1, 2, 3, 4, 5}, - /*exp_output_shape=*/{{}, {}, {}, {}, {}}, - /*exp_output_data=*/{{1}, {2}, {3}, {4}, {5}}); -} - -// int32 tests. -TEST(UnpackOpTest, IntThreeOutputs) { - Check(/*axis=*/0, /*input_shape=*/{3, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{2}, {2}, {2}}, - /*exp_output_data=*/{{1, 2}, {3, 4}, {5, 6}}, - /*type=*/TensorType_INT32); -} - -TEST(UnpackOpTest, IntThreeOutputsAxisOne) { - Check(/*axis=*/1, /*input_shape=*/{3, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{3}, {3}}, - /*exp_output_data=*/{{1, 3, 5}, {2, 4, 6}}, - /*type=*/TensorType_INT32); -} - -TEST(UnpackOpTest, IntOneOutput) { - Check(/*axis=*/0, /*input_shape=*/{1, 6}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{6}}, - /*exp_output_data=*/{{1, 2, 3, 4, 5, 6}}, - /*type=*/TensorType_INT32); -} - -TEST(UnpackOpTest, IntThreeDimensionsOutputs) { - Check(/*axis=*/2, /*input_shape=*/{2, 2, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6, 7, 8}, - /*exp_output_shape=*/{{2, 2}, {2, 2}}, - /*exp_output_data=*/{{1, 3, 5, 7}, {2, 4, 6, 8}}, - /*type=*/TensorType_INT32); -} - -TEST(UnpackOpTest, IntVectorToScalar) { - Check(/*axis=*/0, /*input_shape=*/{5}, - /*input_data=*/{1, 2, 3, 4, 5}, - /*exp_output_shape=*/{{}, {}, {}, {}, {}}, - /*exp_output_data=*/{{1}, {2}, {3}, {4}, {5}}, - /*type=*/TensorType_INT32); -} - -// uint8 tests. -TEST(UnpackOpTest, Uint8ThreeOutputs) { - Check(/*axis=*/0, /*input_shape=*/{3, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{2}, {2}, {2}}, - /*exp_output_data=*/{{1, 2}, {3, 4}, {5, 6}}, - /*type=*/TensorType_UINT8); -} - -TEST(UnpackOpTest, Uint8ThreeOutputsAxisOne) { - Check(/*axis=*/1, /*input_shape=*/{3, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{3}, {3}}, - /*exp_output_data=*/{{1, 3, 5}, {2, 4, 6}}, - /*type=*/TensorType_UINT8); -} - -TEST(UnpackOpTest, Uint8ThreeOutputsNegativeAxisOne) { - Check(/*axis=*/-1, /*input_shape=*/{3, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{3}, {3}}, - /*exp_output_data=*/{{1, 3, 5}, {2, 4, 6}}, - /*type=*/TensorType_UINT8); -} - -TEST(UnpackOpTest, Uint8ThreeOutputsNegativeAxisTwo) { - Check(/*axis=*/-2, /*input_shape=*/{3, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{2}, {2}, {2}}, - /*exp_output_data=*/{{1, 2}, {3, 4}, {5, 6}}, - /*type=*/TensorType_UINT8); -} - -TEST(UnpackOpTest, Uint8OneOutput) { - Check(/*axis=*/0, /*input_shape=*/{1, 6}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{6}}, - /*exp_output_data=*/{{1, 2, 3, 4, 5, 6}}, - /*type=*/TensorType_UINT8); -} - -TEST(UnpackOpTest, Uint8ThreeDimensionsOutputs) { - Check(/*axis=*/2, /*input_shape=*/{2, 2, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6, 7, 8}, - /*exp_output_shape=*/{{2, 2}, {2, 2}}, - /*exp_output_data=*/{{1, 3, 5, 7}, {2, 4, 6, 8}}, - /*type=*/TensorType_UINT8); -} - -TEST(UnpackOpTest, Uint8VectorToScalar) { - Check(/*axis=*/0, /*input_shape=*/{5}, - /*input_data=*/{1, 2, 3, 4, 5}, - /*exp_output_shape=*/{{}, {}, {}, {}, {}}, - /*exp_output_data=*/{{1}, {2}, {3}, {4}, {5}}, - /*type=*/TensorType_UINT8); -} - -// int8 tests. -TEST(UnpackOpTest, Int8ThreeOutputs) { - Check(/*axis=*/0, /*input_shape=*/{3, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{2}, {2}, {2}}, - /*exp_output_data=*/{{1, 2}, {3, 4}, {5, 6}}, - /*type=*/TensorType_INT8); -} - -TEST(UnpackOpTest, Int8ThreeOutputsAxisOne) { - Check(/*axis=*/1, /*input_shape=*/{3, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{3}, {3}}, - /*exp_output_data=*/{{1, 3, 5}, {2, 4, 6}}, - /*type=*/TensorType_INT8); -} - -TEST(UnpackOpTest, Int8ThreeOutputsNegativeAxisOne) { - Check(/*axis=*/-1, /*input_shape=*/{3, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{3}, {3}}, - /*exp_output_data=*/{{1, 3, 5}, {2, 4, 6}}, - /*type=*/TensorType_INT8); -} - -TEST(UnpackOpTest, Int8ThreeOutputsNegativeAxisTwo) { - Check(/*axis=*/-2, /*input_shape=*/{3, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{2}, {2}, {2}}, - /*exp_output_data=*/{{1, 2}, {3, 4}, {5, 6}}, - /*type=*/TensorType_INT8); -} - -TEST(UnpackOpTest, Int8OneOutput) { - Check(/*axis=*/0, /*input_shape=*/{1, 6}, - /*input_data=*/{1, 2, 3, 4, 5, 6}, - /*exp_output_shape=*/{{6}}, - /*exp_output_data=*/{{1, 2, 3, 4, 5, 6}}, - /*type=*/TensorType_INT8); -} - -TEST(UnpackOpTest, Int8ThreeDimensionsOutputs) { - Check(/*axis=*/2, /*input_shape=*/{2, 2, 2}, - /*input_data=*/{1, 2, 3, 4, 5, 6, 7, 8}, - /*exp_output_shape=*/{{2, 2}, {2, 2}}, - /*exp_output_data=*/{{1, 3, 5, 7}, {2, 4, 6, 8}}, - /*type=*/TensorType_INT8); -} - -TEST(UnpackOpTest, Int8VectorToScalar) { - Check(/*axis=*/0, /*input_shape=*/{5}, - /*input_data=*/{1, 2, 3, 4, 5}, - /*exp_output_shape=*/{{}, {}, {}, {}, {}}, - /*exp_output_data=*/{{1}, {2}, {3}, {4}, {5}}, - /*type=*/TensorType_INT8); +TYPED_TEST(UnpackOpTest, VectorToScalar) { + Check( + /*axis=*/0, /*input_shape=*/{5}, + /*input_data=*/{1, 2, 3, 4, 5}, + /*exp_output_shape=*/{{}, {}, {}, {}, {}}, + /*exp_output_data=*/{{1}, {2}, {3}, {4}, {5}}, TestFixture::TENSOR_TYPE); } // bool tests. -TEST(UnpackOpTest, BoolThreeOutputs) { +TEST(UnpackOpTestBool, BoolThreeOutputs) { Check( /*axis=*/0, /*input_shape=*/{3, 2}, /*input_data=*/{true, false, true, false, true, false}, @@ -298,7 +160,7 @@ TEST(UnpackOpTest, BoolThreeOutputs) { /*type=*/TensorType_BOOL); } -TEST(UnpackOpTest, BoolThreeOutputsAxisOne) { +TEST(UnpackOpTestBool, BoolThreeOutputsAxisOne) { Check( /*axis=*/1, /*input_shape=*/{3, 2}, /*input_data=*/{true, false, true, false, true, false}, @@ -307,7 +169,7 @@ TEST(UnpackOpTest, BoolThreeOutputsAxisOne) { /*type=*/TensorType_BOOL); } -TEST(UnpackOpTest, BoolThreeOutputsNegativeAxisOne) { +TEST(UnpackOpTestBool, BoolThreeOutputsNegativeAxisOne) { Check( /*axis=*/-1, /*input_shape=*/{3, 2}, /*input_data=*/{true, false, true, false, true, false}, @@ -316,7 +178,7 @@ TEST(UnpackOpTest, BoolThreeOutputsNegativeAxisOne) { /*type=*/TensorType_BOOL); } -TEST(UnpackOpTest, BoolThreeOutputsNegativeAxisTwo) { +TEST(UnpackOpTestBool, BoolThreeOutputsNegativeAxisTwo) { Check( /*axis=*/-2, /*input_shape=*/{3, 2}, /*input_data=*/{true, false, true, false, true, false}, @@ -325,7 +187,7 @@ TEST(UnpackOpTest, BoolThreeOutputsNegativeAxisTwo) { /*type=*/TensorType_BOOL); } -TEST(UnpackOpTest, BoolOneOutput) { +TEST(UnpackOpTestBool, BoolOneOutput) { Check( /*axis=*/0, /*input_shape=*/{1, 6}, /*input_data=*/{true, false, true, false, true, false}, @@ -334,7 +196,7 @@ TEST(UnpackOpTest, BoolOneOutput) { /*type=*/TensorType_BOOL); } -TEST(UnpackOpTest, BoolThreeDimensionsOutputs) { +TEST(UnpackOpTestBool, BoolThreeDimensionsOutputs) { Check( /*axis=*/2, /*input_shape=*/{2, 2, 2}, /*input_data=*/{true, false, true, false, true, false, true, false}, @@ -344,7 +206,7 @@ TEST(UnpackOpTest, BoolThreeDimensionsOutputs) { /*type=*/TensorType_BOOL); } -TEST(UnpackOpTest, BoolVectorToScalar) { +TEST(UnpackOpTestBool, BoolVectorToScalar) { Check(/*axis=*/0, /*input_shape=*/{5}, /*input_data=*/{true, false, true, false, true}, /*exp_output_shape=*/{{}, {}, {}, {}, {}},