lhutton1 commented on code in PR #12887:
URL: https://github.com/apache/tvm/pull/12887#discussion_r981078225


##########
python/tvm/relay/op/contrib/ethosn.py:
##########
@@ -227,11 +227,13 @@ def qnn_add_pattern():
             is_constant(),
             is_constant(),
         )
-        two_inputs = gen_add_inputs(wildcard(), wildcard())
-        input_is_left = gen_add_inputs(wildcard(), is_constant())
-        input_is_right = gen_add_inputs(is_constant(), wildcard())
 
-        return input_is_left | input_is_right | two_inputs
+        if has_constant_input:
+            input_is_left = gen_add_inputs(wildcard(), is_constant())
+            input_is_right = gen_add_inputs(is_constant(), wildcard())
+            return input_is_left | input_is_right
+        else:
+            return gen_add_inputs(wildcard(), wildcard())

Review Comment:
   I believe this is a quirk of the pattern matching in that constant values 
are only propagated to the operator when `is_constant()` is used, otherwise 
they remain as inputs to the composite function ~- I will double check this 
though~



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to