zxybazh commented on a change in pull request #7809:
URL: https://github.com/apache/tvm/pull/7809#discussion_r618592045
##########
File path: include/tvm/ir/op.h
##########
@@ -270,14 +270,17 @@ class OpRegEntry {
* an higher priority level attribute
* will replace lower priority level attribute.
* Must be bigger than 0.
+ * \param can_override Whether to explicitly allow
+ * overriding the attribute, any non-zero value
+ * implies allowance and 0 means disallowance.
*
* Cannot set with same plevel twice in the code.
*
* \tparam ValueType The type of the value to be set.
*/
template <typename ValueType>
inline OpRegEntry& set_attr(const std::string& attr_name, // NOLINT(*)
- const ValueType& value, int plevel = 10);
+ const ValueType& value, int plevel = 10, int
can_override = 0);
Review comment:
Thanks for pointing it out. In this case, new attributes would be
accepted with a different `plevel` but in the cases of overriding, it becomes a
bit troublesome without `can_override` - we would need to either query the
current `plevel` or try to use a different number somehow. Therefore, I think
it would be more concise to simply add this flag for convenience but definitely
there could be better solutions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]