tutorials/ml: fix TMVA_SOFIE_ONNX tensor name for current PyTorch#21546
Open
Neeraj-x0 wants to merge 1 commit intoroot-project:masterfrom
Open
tutorials/ml: fix TMVA_SOFIE_ONNX tensor name for current PyTorch#21546Neeraj-x0 wants to merge 1 commit intoroot-project:masterfrom
Neeraj-x0 wants to merge 1 commit intoroot-project:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the TMVA SOFIE ONNX tutorial and its companion test artifact to align with tensor naming produced by current PyTorch/ONNX exports (e.g., 0.weight → 0weight after SOFIE name cleaning), fixing a runtime crash when querying tensor shapes/types.
Changes:
- Updated the tutorial macro to query
0weightinstead of the obsolete16weight. - Updated tutorial print statements to match the new tensor name.
- Regenerated
tmva/sofie/test/input_models/Linear_16.onnxusing a current PyTorch export.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tutorials/machine_learning/TMVA_SOFIE_ONNX.C | Updates the hardcoded tensor queried by the tutorial to match current PyTorch naming. |
| tmva/sofie/test/input_models/Linear_16.onnx | Updates the test ONNX model artifact to match current PyTorch export output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The tutorial hardcoded tensor name '16weight' which was generated by
an older PyTorch version. Current PyTorch Sequential modules produce
tensors named '0weight', '2weight', '4weight' (dot stripped by SOFIE).
Updated TMVA_SOFIE_ONNX.C to use '0weight' and regenerated Linear_16.onnx
using current PyTorch to keep tutorial and test model in sync.
Fixes: tutorial crash with runtime_error on GetTensorShape('16weight')
36bd605 to
62f73f0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The tutorial hardcoded tensor name '16weight' which was generated by an older
PyTorch version. Current PyTorch Sequential modules produce tensors named
'0weight', '2weight', '4weight' (dot stripped by SOFIE).
Updated TMVA_SOFIE_ONNX.C to use '0weight' and regenerated Linear_16.onnx
using current PyTorch to keep tutorial and test model in sync.
Fixes: tutorial crash with runtime_error on GetTensorShape('16weight')
This Pull request:
Changes or fixes:
16weightwith0weightin TMVA_SOFIE_ONNX.CChecklist:
This PR fixes #21545