Skip to content
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

[tools/onnx-subgraph] support arbitrary input shape for onnx #14757

Merged
merged 3 commits into from
Mar 4, 2025

Conversation

chenyx113
Copy link
Contributor

related issue: #14534
historical full changes PR: #14613

  1. fixed input shape as default value
  2. user can set the input shape dynamically with guide

ONE-DCO-1.0-Signed-off-by: Youxin Chen yx113.chen@samsung.com

1. fixed input shape as default value
2. user can set the input shape dynamically with guide

ONE-DCO-1.0-Signed-off-by: Youxin Chen <yx113.chen@samsung.com>
@chenyx113 chenyx113 marked this pull request as ready for review February 27, 2025 13:28
@@ -30,7 +30,7 @@ class ModelInference:
Description:
Subgraphsiostxt_path is a txt file that describes the structure of the model graph and
is used to get input/output node names.The model_path contains paths to multiple onnx files.
The load_sessions function will sort the onnx models in the model_path according to the
The load_sessions function will sort the onnx models in the model_path according to the
Copy link
Contributor

Choose a reason for hiding this comment

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

plz split this to another PR. this change is not related to your commit message.

Comment on lines 65 to 68
f"Enter new shape for input '{input_name}' (comma-separated integers), or press Enter to use default: "
)
custom_dtype_str = input(
f"Enter data type for input '{input_name}' ('f' for float32, 'i' for int64), or press Enter to use default: "
Copy link
Contributor

Choose a reason for hiding this comment

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

it would be nice if you coult split lines so that it comes in 100 cols.

dtype = dtype_map.get(custom_dtype_str.strip(), None)
if dtype is None:
print("Invalid data type, please enter 'f' or 'i'.")
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

Q) if dtype is invalid contunue seems to skip input_name input. is it OK with it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, thank you for suggestion, I add dtype default setting for exception case, please check

update code as review,  split too long lines, and add dtype default setting for exception case
fix format checking issue
Copy link
Contributor

@seanshpark seanshpark left a comment

Choose a reason for hiding this comment

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

LGTM

@seanshpark seanshpark merged commit 6d5816e into Samsung:master Mar 4, 2025
5 checks passed
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.

2 participants