Skip to content

[tmva][sofie] throw on invalid BatchNormalization input count#21773

Open
harz05 wants to merge 1 commit intoroot-project:masterfrom
harz05:fix/sofie-batchnorm-invalid-input-count
Open

[tmva][sofie] throw on invalid BatchNormalization input count#21773
harz05 wants to merge 1 commit intoroot-project:masterfrom
harz05:fix/sofie-batchnorm-invalid-input-count

Conversation

@harz05
Copy link
Copy Markdown
Contributor

@harz05 harz05 commented Apr 2, 2026

Changes:

ParseBatchNormalization only constructed the operator when input_size() == 5 but had no else clause, so nodes with fewer inputs silently returned a null unique_ptr and crashed later in Generate() with an unrelated error message.

I've simply added an else throw to reject invalid input counts immediately at parse time with a clear error message, consistent with other parsers in the codebase.

Checklist:

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

This PR fixes #21759

@harz05 harz05 requested a review from lmoneta as a code owner April 2, 2026 10:11
@harz05
Copy link
Copy Markdown
Contributor Author

harz05 commented Apr 2, 2026

I'd also like to add a regression test for this(verifying Parse() throws std::runtime_error) but im not sure what's the best to add it.
TestCustomModelsFromONNX.cxx doesn't currently link against ROOTTMVASofieParser and placing an invalid .onnx in input_models/ would break the emitFromONNX fixture.
@guitargeek

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] ParseBatchNormalization accepts invalid input count and fails late

1 participant