Rename intermediate values to _val and _const | feat(torchlib)#881
Rename intermediate values to _val and _const | feat(torchlib)#881justinchuby merged 1 commit intomainfrom
_val and _const | feat(torchlib)#881Conversation
[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
thiagocrepaldi
left a comment
There was a problem hiding this comment.
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 <bowbao@microsoft.com>
Stack from ghstack (oldest at bottom):
_valand_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: