rutkoor commented on code in PR #15679:
URL: https://github.com/apache/tvm/pull/15679#discussion_r1335492704


##########
python/tvm/relax/transform/legalize_ops/manipulate.py:
##########
@@ -205,3 +213,16 @@ def te_layout_transform(data, name):
     output_dtype = call_args[0].struct_info.dtype
     output_sinfo = [TensorStructInfo(output_shape, output_dtype)]
     return call_tir(gvar, call_args, output_sinfo, tir_vars)
+
+
+@register_legalize("relax.remove_pad")
+def _remove_pad(bb: BlockBuilder, call: Call) -> Expr:
+    orig_shape = call.attrs.orig_shape
+
+    def te_remove_pad(data):
+        """
+        Returns a new compute that restrict the original expression to the 
shape of orig_shape
+        """
+        return te.compute(orig_shape, data, name="te_remove_pad")

Review Comment:
   Hi @masahi, the error looks something like this,
   
   `ValueError: StructuralEqual check failed, caused by lhs at 
<root>.functions[I.GlobalVar("remove_pad")].body.block.body.body.block.iter_vars[0].dom.min.dtype
 and rhs at 
<root>.functions[I.GlobalVar("remove_pad")].body.block.body.body.block.iter_vars[0].dom.min.dtype`
   
   where the lhs dtype is coming out to be `int32` when running the 
`alter_op_impl `pass, and rhs dtype is `int64` which is coming from `Expected 
module`.
   
   I have commited a change in `src/te/operation/compute_op.cc` which is 
resolving the issue.
   My question is, does the change in `src/te/operation/compute_op.cc` should 
go as a separate PR or can I have it in this PR only?



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