masahi commented on a change in pull request #8669:
URL: https://github.com/apache/tvm/pull/8669#discussion_r685620496



##########
File path: python/tvm/topi/x86/dense_alter_op.py
##########
@@ -39,6 +40,17 @@ def _alter_dense_layout(attrs, inputs, tinfos, out_type):
         relay.op.get("nn.dense"), attrs, tinfos, out_type, target
     )
     workload = autotvm.task.get_workload(outs)
+
+    data_type = 
relay.transform.InferType()(IRModule.from_expr(inputs[0]))["main"].body.checked_type

Review comment:
       `tinfos` contains the shape for original inputs 
https://github.com/apache/tvm/blob/c25b8fae2f29dd9d23aa2487e75450dec5340b75/src/relay/transforms/alter_op_layout.cc#L84-L87
   
   But here, I need to know, "Would `data` input be packed or not (2D or 3D), 
during AlterOpLayout transform?". So I need types for `new_args` in 
https://github.com/apache/tvm/blob/c25b8fae2f29dd9d23aa2487e75450dec5340b75/src/relay/transforms/alter_op_layout.cc#L90.
 But type inference is apparently not applied to `new_arg` there, so the only 
place to get the type of transformed input is inside topi callback (which feels 
weird to me).




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