message: Add more tests about axis=dims-1. Iterate from 1 to 10 to ensure edge cases are correct.
diff: @@ -209,6 +209,19 @@ TEST_P(ArgMinMaxOpTest, GetMaxArgOutput64) {
  EXPECT_THAT(model.GetOutputShape(), ElementsAreArray({1, 1, 2}));
  }
  +TEST_P(ArgMinMaxOpTest, GetMaxArgFloatLastAxis) {
  + std::vector<float> input{0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0};
  + for (int i = 1; i < 10; ++i) {
  + ArgMaxOpModel model({i}, TensorType_FLOAT32, 0, AxisType(), ConstantAxis(),
  + OutputType());
  + model.PopulateTensor<float>(
  + model.input(), std::vector<float>(input.begin(), input.begin() + i));
  + model.Invoke();
  +
  + ValidateOutput(model, {i - 1});
  + }
  +}
  +
  TEST_P(ArgMinMaxOpTest, GetMinArgFloat) {
  ArgMinOpModel model({1, 1, 1, 4}, TensorType_FLOAT32, 3, AxisType(),
  ConstantAxis(), OutputType());
  @@ -259,5 +272,18 @@ TEST_P(ArgMinMaxOpTest, GetMinArgOutput64) {
  EXPECT_THAT(model.GetOutputShape(), ElementsAreArray({1, 1, 2}));
  }
  +TEST_P(ArgMinMaxOpTest, GetMinArgFloatLastAxis) {
  + std::vector<float> input{1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1};
  + for (int i = 1; i < 10; ++i) {
  + ArgMinOpModel model({i}, TensorType_FLOAT32, 0, AxisType(), ConstantAxis(),
  + OutputType());
  + model.PopulateTensor<float>(
  + model.input(), std::vector<float>(input.begin(), input.begin() + i));
  + model.Invoke();
  +
  + ValidateOutput(model, {i - 1});
  + }
  +}
  +
  } // namespace
  } // namespace tflite
  