cchung100m commented on code in PR #18491:
URL: https://github.com/apache/tvm/pull/18491#discussion_r2597151441


##########
src/relax/backend/vm/vm_shape_lower.cc:
##########
@@ -399,6 +399,23 @@ class VMShapeLowerMutator
       return ffi::GetRef<Expr>(op);
     }
 
+    // Check if all expressions are computed if not mark variables as ready 
and trigger computation
+    for (const PrimExpr& expr : op->values) {
+      if (!expr->IsInstance<IntImmNode>()) {
+        auto it = slot_map_.find(expr);
+        if (it != slot_map_.end() && !it->second->value_computed) {
+          // If it's a variable, mark it as ready for computation
+          if (expr.as<tir::VarNode>()) {
+            it->second->value_computed = true;

Review Comment:
   Hi @tlopex 
   
   Thanks for the suggestion. 
   Should we extend `ComputePrimValue`() to handle ShapeExpr nodes with 
compound PrimExpr?
   
https://github.com/apache/tvm/blob/main/src/relax/transform/compute_prim_value.cc#L65



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