-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[EP ABI] Node_GetAttrByName returns ORT_NOT_FOUND with non-existing attr name #25565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
adrianlizarraga
merged 14 commits into
main
from
adrianl/EpABI_GetAttrByName_NotFoundOk
Jul 29, 2025
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6cab947
[EP ABI] Allow calling Node_GetAttrByName with non-existing attr name
adrianlizarraga 1aa313e
Introduce ORT_NOT_FOUND error code
adrianlizarraga fecad38
Update OrtErrorCode enum for other bindings
adrianlizarraga 9a9168e
Fix java enum
adrianlizarraga 02fd51d
Fix C/C++ doc: Graph_GetGraphView
adrianlizarraga db51908
Try to return default attr value
adrianlizarraga caf4e6b
Resolve() fills in default values if constant. Only need check for ot…
adrianlizarraga aafd99f
Merge branch 'main' into adrianl/EpABI_GetAttrByName_NotFoundOk
adrianlizarraga 39aa7ae
Add test with existing attr
adrianlizarraga d2f3ab9
fix warning as error
adrianlizarraga 3be4fd5
Add script to create test model
adrianlizarraga 056b133
Add new ORT_NOT_FOUND to jni
adrianlizarraga 61090d4
Update array size
adrianlizarraga 3fdfa24
Address review comments
adrianlizarraga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
Binary file not shown.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. | ||
|
|
||
| import numpy as np | ||
| import onnx | ||
|
|
||
|
|
||
| def main(): | ||
| inp_shape = (1, 2, 8, 8) | ||
| input_0 = onnx.helper.make_tensor_value_info("input_0", onnx.TensorProto.FLOAT, inp_shape) | ||
| output_0 = onnx.helper.make_tensor_value_info("output_0", onnx.TensorProto.FLOAT, None) | ||
|
|
||
| weight_data = [ | ||
| [[[-1.5, 0.0], [0.2, 1.5]], [[-1.5, 0.0], [0.2, 1.5]]], | ||
| [[[-1.0, 0.0], [0.1333, 1.0]], [[-1.0, 0.0], [0.1333, 1.0]]], | ||
| ] | ||
| weight = onnx.numpy_helper.from_array(np.array(weight_data, dtype=np.float32), "weight") | ||
| bias = onnx.numpy_helper.from_array(np.array([0.0, 0.0], dtype=np.float32), "bias") | ||
| conv_node = onnx.helper.make_node("Conv", ["input_0", "weight", "bias"], ["output_0"], name="Conv0") | ||
| graph = onnx.helper.make_graph( | ||
| [conv_node], | ||
| "Convf32", | ||
| [input_0], | ||
| [output_0], | ||
| initializer=[weight, bias], | ||
| ) | ||
| opset_imports = [onnx.helper.make_opsetid("", 21)] | ||
| model = onnx.helper.make_model(graph, opset_imports=opset_imports) | ||
| model = onnx.shape_inference.infer_shapes(model) | ||
|
|
||
| onnx.checker.check_model(model, True) | ||
| onnx.save_model(model, "conv_default_attrs.onnx") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.