From 184054b6cf2d5e666b31ae49bb8fc63ada5441df Mon Sep 17 00:00:00 2001 From: edgchen1 <18449977+edgchen1@users.noreply.github.com> Date: Thu, 17 Aug 2023 16:08:13 -0700 Subject: [PATCH] update slice tests to use INT64_MIN instead of INT64_MAX end values in most tests that have negative steps. disable CoreML EP if ONNX shape inferencing result doesn't match. --- .../test/providers/cpu/tensor/slice_op.test.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/onnxruntime/test/providers/cpu/tensor/slice_op.test.cc b/onnxruntime/test/providers/cpu/tensor/slice_op.test.cc index bd7be55e929d1..108bb488ec960 100644 --- a/onnxruntime/test/providers/cpu/tensor/slice_op.test.cc +++ b/onnxruntime/test/providers/cpu/tensor/slice_op.test.cc @@ -49,6 +49,10 @@ void RunSliceTest(const std::vector& input_dims, SessionOptions so; ASSERT_STATUS_OK(so.config_options.AddConfigEntry(kOrtSessionOptionsConfigStrictShapeTypeInference, "0")); + if (onnx_shape_disagreement) { + excluded_providers.insert(kCoreMLExecutionProvider); + } + if (!v10_only) { OpTester testv9("Slice", 9); testv9.AddAttribute("starts", starts); @@ -548,7 +552,7 @@ TEST(SliceTest, Slice2D_ReverseAllAxes) { RunSliceTest({2, 2}, {1.0f, 2.0f, 3.0f, 4.0f}, {-1, -1}, - {std::numeric_limits::max(), std::numeric_limits::max()}, + {std::numeric_limits::min(), std::numeric_limits::min()}, {0, 1}, {-1, -1}, {2, 2}, @@ -565,7 +569,7 @@ TEST(SliceTest, Slice2D_ReverseSubsetOfAxes_1) { RunSliceTest({2, 2}, {1.0f, 2.0f, 3.0f, 4.0f}, {-1}, - {std::numeric_limits::max()}, + {std::numeric_limits::min()}, {1}, // axis = 1 only {-1}, {2, 2}, @@ -582,7 +586,7 @@ TEST(SliceTest, Slice2D_ReverseSubsetOfAxes_2) { RunSliceTest({2, 2}, {1.0f, 2.0f, 3.0f, 4.0f}, {-1}, - {std::numeric_limits::max()}, // end of dimension + {std::numeric_limits::min()}, // end of dimension {0}, // axis = 0 only {-1}, {2, 2}, @@ -636,7 +640,7 @@ TEST(SliceTest, Slice2D_ReverseSubsetOfNegAxes_1) { RunSliceTest({2, 2}, {1.0f, 2.0f, 3.0f, 4.0f}, {-1}, - {std::numeric_limits::max()}, + {std::numeric_limits::min()}, {-1}, // axis = -1 only {-1}, {2, 2},