@@ -92,6 +92,7 @@ constexpr auto modelDataSuffix = "_FromONNX.dat";
9292#include " input_models/references/Log.ref.hxx"
9393#include " input_models/references/Elu.ref.hxx"
9494#include " input_models/references/Equal.ref.hxx"
95+ #include " input_models/references/EluAlpha.ref.hxx"
9596#include " input_models/references/LessOrEqual.ref.hxx"
9697#include " input_models/references/GreaterOrEqual.ref.hxx"
9798#include " input_models/references/Less.ref.hxx"
@@ -308,6 +309,22 @@ TEST(ONNX, Elu)
308309 EXPECT_LE (std::abs (output[i] - correct[i]), TOLERANCE);
309310 }
310311 }
312+ TEST (ONNX, EluAlpha)
313+ {
314+ constexpr float TOLERANCE = DEFAULT_TOLERANCE;
315+ // Regression test for alpha != 1.0 (fixes #21539)
316+ std::vector<float > input ({
317+ 1.0 , -2.0 , 3.0 , 0.5 , -1.0 , 2.0
318+ });
319+ ASSERT_INCLUDE_AND_RUN (std::vector<float >, " EluAlpha" , input);
320+ // Checking output size
321+ EXPECT_EQ (output.size (), sizeof (EluAlpha_ExpectedOutput::outputs) / sizeof (float ));
322+ float *correct = EluAlpha_ExpectedOutput::outputs;
323+ // Checking every output value, one by one
324+ for (size_t i = 0 ; i < output.size (); ++i) {
325+ EXPECT_LE (std::abs (output[i] - correct[i]), TOLERANCE);
326+ }
327+ }
311328
312329TEST (ONNX, Constant)
313330{
0 commit comments