tqchen commented on code in PR #14394:
URL: https://github.com/apache/tvm/pull/14394#discussion_r1184303072


##########
src/relax/op/op.cc:
##########
@@ -73,6 +73,40 @@ StructInfo InferStructInfoShapeOf(const Call& call, const 
BlockBuilder& ctx) {
   return ShapeStructInfo(tensor_shape->values);
 }
 
+// call_pure_packed
+
+StructInfo InferStructInfoCallPurePacked(const Call& call, const BlockBuilder& 
ctx) {
+  if (call->args.size() < 1) {
+    ctx->ReportFatal(Diagnostic::Error(call)
+                     << "call_pure_packed must be called with at least one 
argument");
+  }
+
+  // the callee must be an opaque function
+  auto callee = call->args[0];
+  ICHECK(!callee.as<OpNode>()) << "call_pure_packed cannot be used with an op 
node";
+  auto opt = MatchStructInfo<FuncStructInfo>(callee);
+  ICHECK(opt) << "Callee must have a function struct info";
+  FuncStructInfo finfo = opt.value();
+  ICHECK(finfo->IsOpaque()) << "call_pure_packed must be called with an opaque 
function, but "
+                            << callee << " is not opaque";
+
+  // derives the struct info of the result as it would for a call to the inner 
args
+  auto hypothetical_call = UnwrapCallPure(call);

Review Comment:
   How about we have the same common function InferStructInfoCallPacked  and 
register that same function for call_pure_packed and call_packed as they are 
similar



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