diff --git a/onnxruntime/test/contrib_ops/layer_norm_op_test.cc b/onnxruntime/test/contrib_ops/layer_norm_op_test.cc index 67b47640ac834..da39cae55abeb 100644 --- a/onnxruntime/test/contrib_ops/layer_norm_op_test.cc +++ b/onnxruntime/test/contrib_ops/layer_norm_op_test.cc @@ -280,7 +280,7 @@ TYPED_TEST(LayerNormTest, LayerNorm17_opset) { test.AddInput("x", dims, GetTypedArray({1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f})); test.AddInput("gamma", {3}, GetTypedArray({1.0f, 1.0f, 1.0f}), is_initializer); test.AddOutput("output", dims, GetTypedArray({-1.2247f, 0.0f, 1.2247f, -1.2247f, 0.0f, 1.2247f})); - if (std::is_same::value|| is_initializer) { + if (std::is_same::value) { std::vector> execution_providers; execution_providers.push_back(DefaultCoreMLExecutionProvider(true)); // coreml EP requires weight and bias to be initializers @@ -292,8 +292,14 @@ TYPED_TEST(LayerNormTest, LayerNorm17_opset) { test.Run(); } }; + if (std::is_same::value) { +#if !definded(COREML_ENABLE_MLPROGRAM) && !defined(USE_CUDA) + return; +#endif + } + run_test(false); -#ifdef COREML_ENABLE_MLPROGRAM +#if definded(COREML_ENABLE_MLPROGRAM) // gamma as initialized will fail for CPUEP run_test(true); #endif