onnxruntime
51c546b0 - Validate NodeArg creation (#28429)

Commit
2 days ago
Validate NodeArg creation (#28429) This pull request improves the robustness of ONNX model loading and validation by adding stricter checks for malformed models and enhancing test coverage. The most important changes are: **Model Loading Robustness:** * Added an `ORT_ENFORCE` check in `Graph::InitializeStateFromModelFileGraphProto()` to ensure that every initializer in the model has a corresponding `NodeArg`, preventing crashes when loading malformed models. **Test Coverage for Malformed Models:** * Added a test (`MalformedModelInitializerWithoutNodeArg`) to verify that a model with an initializer lacking a matching `NodeArg` is properly rejected during loading, ensuring graceful error handling. * Added a test (`MalformedModelEmptySubgraph`) to verify that a model with a node containing an empty subgraph attribute is rejected, further ensuring structural validation of models.
Author
Parents
Loading