gemini-code-assist[bot] commented on code in PR #18965:
URL: https://github.com/apache/tvm/pull/18965#discussion_r3025861742


##########
docs/deep_dive/relax/learning.rst:
##########
@@ -167,8 +171,8 @@ for the end-to-end model execution. The code block below 
shows a TVMScript imple
             n = T.int64()
             with R.dataflow():
                 lv = R.call_tir(cls.linear, (x, w0, b0), 
out_sinfo=R.Tensor((n, 256), dtype="float32"))
-                lv1 = R.call_tir(cls.relu, (lv0,), out_sinfo=R.Tensor((n, 
256), dtype="float32"))
-                lv2 = R.call_tir(cls.linear, (lv1, w1, b1), 
out_sinfo=R.Tensor((b, 10), dtype="float32"))
+                lv1 = R.call_tir(cls.relu, (lv,), out_sinfo=R.Tensor((n, 256), 
dtype="float32"))
+                lv2 = R.call_tir(cls.linear, (lv1, w1, b1), 
out_sinfo=R.Tensor((n, 10), dtype="float32"))

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   While these lines correctly fix the usage of undefined variables, the 
definition of `n` on line 172 (`n = T.int64()`) is problematic. It introduces a 
new symbolic variable that shadows the symbolic dimension `n` from the function 
signature, breaking the connection between the input and intermediate tensor 
shapes.
   
   For a more robust and clearer example, consider removing line 172. The `n` 
used in the `R.Tensor` struct infos will then correctly refer to the symbolic 
dimension from the input tensor's shape.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to