Skip to content

Commit 2c87a2b

Browse files
committed
Fix GatherND error tests: register CPU provider explicitly using GTEST_SKIP
1 parent f44bc30 commit 2c87a2b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

onnxruntime/test/providers/cpu/tensor/gather_nd_op_test.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@ TEST(GatherNDOpTest, GatherND_batch_dims_mismatch_error) {
339339
test.AddInput<int64_t>("indices", {2, 1}, {1, 2});
340340
test.AddOutput<float>("output", {2}, {0.f, 0.f}); // dummy output, won't be used
341341
test.ConfigEp(DefaultCpuExecutionProvider());
342+
if (!DefaultCpuExecutionProvider()) {
343+
GTEST_SKIP() << "Test only valid for CPU EP";
344+
}
342345
test.Run(OpTester::ExpectResult::kExpectFailure,
343346
"GatherND: indices batch size (2) is not divisible by input batch size (3)");
344347
}
@@ -352,6 +355,9 @@ TEST(GatherNDOpTest, GatherND_zero_batch_dims_error) {
352355
test.AddInput<int64_t>("indices", {2, 1}, {1, 2});
353356
test.AddOutput<float>("output", {2}, {0.f, 0.f}); // dummy output, won't be used
354357
test.ConfigEp(DefaultCpuExecutionProvider());
358+
if (!DefaultCpuExecutionProvider()) {
359+
GTEST_SKIP() << "Test only valid for CPU EP";
360+
}
355361
test.Run(OpTester::ExpectResult::kExpectFailure,
356362
"GatherND: input tensor batch dimensions cannot be zero");
357363
}

0 commit comments

Comments
 (0)