Hzfengsy commented on code in PR #15924:
URL: https://github.com/apache/tvm/pull/15924#discussion_r1358136474


##########
python/tvm/relax/frontend/onnx/onnx_frontend.py:
##########
@@ -637,6 +637,11 @@ def _impl_v14(cls, bb, inputs, attr, params):
         x = inputs[0]
         k = inputs[1] if len(inputs) > 1 else 0
 
+        if isinstance(k, relax.Var) and k.name_hint in params:
+            k = get_constant(k, params)
+        else:
+            k = 0

Review Comment:
   Also, what will happen if `k` is a constant instead of an input? Please also 
add a test case for it.



##########
python/tvm/relax/frontend/onnx/onnx_frontend.py:
##########
@@ -637,6 +637,11 @@ def _impl_v14(cls, bb, inputs, attr, params):
         x = inputs[0]
         k = inputs[1] if len(inputs) > 1 else 0
 
+        if isinstance(k, relax.Var) and k.name_hint in params:
+            k = get_constant(k, params)
+        else:
+            k = 0

Review Comment:
   Why do we need to set `k` to 0? It should already be done in line 638 



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