-
Notifications
You must be signed in to change notification settings - Fork 112
Add the heuristic of AddN op using reduce_sum op for parsing pb file (TF) #4251
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
Open
kentqian
wants to merge
13
commits into
develop
Choose a base branch
from
kqian/addn_with_reduce
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
876fbfc
1. AddN use reduce_sum op for tensorflow
kentqian c3e1b05
1. Use the heuristic with reduce_sum op when parsing AddN op in tenso…
kentqian 1b88398
Merge branch 'kqian/addn_with_reduce' of https://github.com/ROCm/AMDM…
kentqian 1ece3f1
added the reference test
kentqian d612e20
transform instead of for loop
kentqian 9d45b3f
tidy check
kentqian 6888e8a
Modified concat logic for when dynamic shapes are able to be converte…
kentqian ace04a8
format
kentqian 5f78453
added the parse addn tf test
kentqian d80f76a
format
kentqian 7d89704
Merge branch 'develop' of https://github.com/ROCm/AMDMIGraphX into kq…
kentqian 5de1a06
tidy and license
kentqian cd7e8a6
format
kentqian 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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -40,12 +40,34 @@ struct parse_addn : op_parser<parse_addn> | |||||
| const tf_parser::node_info& info, | ||||||
| std::vector<instruction_ref> args) const | ||||||
| { | ||||||
| instruction_ref sum = args[0]; | ||||||
| for(auto i = 1; i < args.size(); i++) | ||||||
| if(args.size() == 1) | ||||||
| return args[0]; | ||||||
|
|
||||||
| if(args.size() < 5) // using heuristic when args exceed over 5 elements | ||||||
|
||||||
| if(args.size() < 5) // using heuristic when args exceed over 5 elements | |
| if(args.size() < 5) // using chain addition when args are less than 5 elements |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
|
|
||
| 3 | ||
| 0Placeholder* | ||
| dtype0* | ||
| shape: ð | ||
| 3 | ||
| 1Placeholder* | ||
| dtype0* | ||
| shape: ð | ||
| 3 | ||
| 2Placeholder* | ||
| dtype0* | ||
| shape: ð | ||
| 3 | ||
| 3Placeholder* | ||
| dtype0* | ||
| shape: ð | ||
| 3 | ||
| 4Placeholder* | ||
| dtype0* | ||
| shape: ð | ||
| 3 | ||
| 5Placeholder* | ||
| dtype0* | ||
| shape: ð | ||
| 3 | ||
| 6Placeholder* | ||
| dtype0* | ||
| shape: ð | ||
| 3 | ||
| 7Placeholder* | ||
| dtype0* | ||
| shape: ð | ||
| 3 | ||
| 8Placeholder* | ||
| dtype0* | ||
| shape: ð | ||
| 3 | ||
| 9Placeholder* | ||
| dtype0* | ||
| shape: ð | ||
| = | ||
| addn1AddN0123456789* | ||
| N | ||
| * | ||
| T0"ð |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modifying the
inputsparameter directly can lead to unexpected side effects since it's passed by value but contains references to shapes. This modification affects the original shapes which may be used elsewhere. Consider creating a local copy of inputs or using a different approach to handle mixed shapes.