-
Notifications
You must be signed in to change notification settings - Fork 64
Rename intermediate values to _val
and _const
| feat(torchlib)
#881
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
Conversation
[ghstack-poisoned]
Could you describe motivation in description? |
Codecov Report
@@ Coverage Diff @@
## main #881 +/- ##
==========================================
+ Coverage 76.56% 76.57% +0.01%
==========================================
Files 112 112
Lines 13396 13413 +17
Branches 1346 1349 +3
==========================================
+ Hits 10256 10271 +15
+ Misses 2806 2805 -1
- Partials 334 337 +3
|
Done |
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom): * #883 * __->__ #882 * #881 Remove the duplicate check_model message when displaying
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.
Good change.
Would the distinction between _val
and _const
be ambiguous for the scenario where a _val
node has a constant input, which would make the node have a constant output, but with the name _val
that makes it look like a non-constant?
e.g. _val_1 = Max(_const_1)
mas gets a _val_1
name, but max of constant is a constant, and thus the name could actually be _const_2
?
If that is the case, all nodes could be called _val_
and prevent the semantic meaning of dynamic/constant
That works too! I will update to val if no one thinks otherwise |
Use `_val` for all intermediate values to avoid ambiguity based on comment: #881 (review) Co-authored-by: Bowen Bao <[email protected]>
Stack from ghstack (oldest at bottom):
_val
and_const
| feat(torchlib) #881The torchscript ONNX graph generator creates numeric value names by default (
0
,1
). These are not legal ONNX tensor names, since ONNX requires the names to be valid C variable names. This change updates the names by prepending a prefix_val_
or_const_
to make them valid ONNX names. It also improves readability by making the names less likely to be confused with shape values.I decided to use the
_
prefix to reduce the chance of name collision with FX names.After:
Before: