-
Notifications
You must be signed in to change notification settings - Fork 65
Merge attrs
and attr_protos
in IRFunction
| chore(irbuilder)
#625
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
Move version_utils to `_internal` so that it can be used my onnxscript [ghstack-poisoned]
[ghstack-poisoned]
Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom): * #626 * #625 * __->__ #624 Move version_utils to `_internal` so that it can be used my onnxscript
The changes aren't stacked? It seems being piled up to the next commit? |
That's the thing I talked about with ghstack and how we use github to merge which is annoying. I changed the base branch back. Try now? |
Working! |
This comment was marked as resolved.
This comment was marked as resolved.
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
Codecov Report
@@ Coverage Diff @@
## main #625 +/- ##
==========================================
- Coverage 73.95% 73.81% -0.15%
==========================================
Files 107 107
Lines 11389 11390 +1
Branches 1185 1185
==========================================
- Hits 8423 8407 -16
- Misses 2645 2657 +12
- Partials 321 326 +5
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
@@ -108,10 +108,16 @@ def _opt_var_to_str(x): | |||
|
|||
|
|||
class IRAttributeValue: | |||
"""An attribute value (representing an actual parameter).""" | |||
"""An attribute value (representing an actual parameter). |
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.
With the current changes, this class is being used to cover both actual parameters (which are values) as well as formal parameters (with or without a default-value). I am not 100% sure if we should unify all of these into a single type/class. But if we do, may be the name should be changed to reflect this? May be IRAttributeParameter
? And, of course, the above documentation line should be changed to actual+formal parameter.
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.
For example, should we add an assertion/check in the IRStmt init method that all attrs have a default-value?
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.
Thanks! I added IRAttributeParameter. I wonder if it should be a subclass of IRAttributeValue or be its own class? For now I subclassed but semantically should it be that?
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.
I made an update on IRAttributeParameter. PTAL
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.
Yes, semantically it should not be a subclass. The current form is preferable.
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by adding a `has_default` field in `IRAttributeValue`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
|
||
It may or may not carry a default value. | ||
|
||
Attributes: |
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.
Is this out-dated, or is this the accepted convention? That is, should this list be "name, type, default_value" or as below?
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.
I should add the other attributes. thanks for catching
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.
Done
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.
I don't see the changes. Not sure if something's wrong with what I am seeing, or the change was not pushed.
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.
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.
Yes
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.
Wait so was this good or did you mean something else?
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.
I guess I am trying to understand the conventions here. The current form makes sense as the "public interface" exposed. Technically, however, default_value
is also an attribute. Is the idea that it is "private"? Would renaming default_value
to _default_value
be appropriate?
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.
Added default_value. Thanks!
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…tion` | chore(irbuilder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
…builder)" Merge the two list in `IRFunction` by changing its type to `IRAttributeParameter`. This way we retain type information for all attributes. It is useful for creating correct `OpSchema`s and `ParamSchema`s in the next PR. Also Include `typeinfo` in `add_attr_parameter`. [ghstack-poisoned]
ghstack-source-id: 24c2201 Pull Request resolved: microsoft/onnxscript#625 Signed-off-by: Justin Chu <[email protected]>
Stack from ghstack (oldest at bottom):
attrs
andattr_protos
inIRFunction
| chore(irbuilder) #625Merge the two list in
IRFunction
by changing its type toIRAttributeParameter
. This way we retain type information for all attributes. It is useful for creating correctOpSchema
s andParamSchema
s in the next PR.Also Include
typeinfo
inadd_attr_parameter
.