Skip to content

[tmva][sofie] Read the alpha and gamma attributes of Selu - #23743

Open
Maher-star-eng wants to merge 1 commit into
root-project:masterfrom
Maher-star-eng:sofie-selu-attributes
Open

Maher-star-eng wants to merge 1 commit into
root-project:masterfrom
Maher-star-eng:sofie-selu-attributes

Conversation

@Maher-star-eng

Copy link
Copy Markdown
Contributor

This Pull request:

Makes SOFIE read the alpha and gamma attributes of the ONNX Selu operator instead of always using their default values.

Changes or fixes:

  • ParseSelu now reads alpha and gamma, defaulting to the values of the ONNX specification, in the same way ParseElu reads alpha.
  • ROperator_Selu stores both values and writes them into the generated code with full float precision (max_digits10), as ROperator_Elu does. Since alpha is now a float, std::min(0.0, ...) became std::min(float(0.0), ...).
  • New test ONNX.SeluAttributes: a Selu node with alpha=2.0, gamma=3.0 and inputs on both sides of zero; the reference comes from the ONNX reference implementation. It fails without the fix on all four values and passes with it. All 11 SOFIE tests pass locally, including LinearWithSelu with the default values.

AI disclosure: I found this bug with a script that runs the ONNX operator tests from the onnx Python package through SOFIE (test_selu and test_selu_example gave wrong values); the script was written by Claude (a claude-sonnet-5-5 agent) .
Also it gave me directions for the fix . I wrote the fix and the test by myself , and reviewed the changes and test result .

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

This PR fixes #23734

ParseSelu ignored the alpha and gamma attributes and ROperator_Selu hard-coded their default values, so a Selu node with other values gave wrong results. Read both attributes, with the ONNX defaults, and write them into the generated code with full float precision, as Elu does for its alpha. Add a test model with non-default values.

Fixes root-project#23734

Assisted-by: claude-code:claude-opus-5-5
Copilot AI balanced review requested due to automatic review settings October 16, 2026 15:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[tmva][sofie] Selu ignores its alpha and gamma attributes

2 participants