mbs-octoml commented on a change in pull request #8597:
URL: https://github.com/apache/tvm/pull/8597#discussion_r683041630



##########
File path: src/relay/backend/interpreter.cc
##########
@@ -359,32 +446,25 @@ class Interpreter : public ExprFunctor<ObjectRef(const 
Expr& n)>,
       setter(arg_counter + i, arr);
     };
 
-    auto ret_type = func->body->checked_type();
     size_t out_cnt = 0;
-    if (auto rtype = ret_type.as<TupleTypeNode>()) {
+    if (auto rtype = ftn->ret_type.as<TupleTypeNode>()) {
+      // TODO(mbs): Recursive flatten?

Review comment:
       Done. Nice tetris effect of cascading simplifications, we should do this 
everywhere.

##########
File path: src/relay/backend/interpreter.cc
##########
@@ -476,17 +552,19 @@ class Interpreter : public ExprFunctor<ObjectRef(const 
Expr& n)>,
     };
 
     Array<Shape> out_shapes;
-    auto ret_type = func->body->checked_type();
-    bool is_dyn = IsDynamic(ret_type);
+    bool is_dyn = IsDynamic(ftn->ret_type);
 
     if (is_dyn) {
-      ICHECK(func->HasNonzeroAttr(attr::kPrimitive));
-      out_shapes = ComputeDynamicShape(func, args);
+      ICHECK(prim_shape_fn_var.defined());
+      ICHECK(prim_shape_fn_states.defined());
+      out_shapes =
+          ComputeDynamicShape(prim_shape_fn_var, all_prim_shape_fn_vars, 
prim_shape_fn_states,
+                              num_shape_inputs, num_shape_outputs, args);
     }
 
-    PackedFunc packed_func = compiler_->JIT(CCacheKey(func, target_));
     TVMRetValue rv;
-    if (const TupleTypeNode* rtype = 
func->body->checked_type().as<TupleTypeNode>()) {
+    if (const TupleTypeNode* rtype = ftn->ret_type.as<TupleTypeNode>()) {
+      // TODO(mbs): Recursive flatten?

Review comment:
       done.




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