masahi commented on code in PR #13660:
URL: https://github.com/apache/tvm/pull/13660#discussion_r1057915918


##########
python/tvm/relay/qnn/op/canonicalizations.py:
##########
@@ -23,10 +23,25 @@
 
 
 def run_const_expr(expr: "relay.Expr") -> np.ndarray:
-    """Evaluate a const expression, receiving result as np array."""
-    mod = tvm.IRModule.from_expr(expr)
-    vm_exe = relay.create_executor("vm", mod=mod)
-    return vm_exe.evaluate()().asnumpy()
+    """Evaluate a const expression, receiving result as np array.
+
+    If a number of passes are disabled in the current Pass Context, then there 
is no need to disable
+    these passes for const expression evaluation as well. That's why we use 
empty list
+    "disabled_pass=[]", all other arguments are inherited from the current 
Pass Context.

Review Comment:
   I see, you do want to enable QNN legalization (which is disabled in the 
original ctx) here.



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