You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/06/07 21:17:16 UTC

[GitHub] [tvm] anijain2305 commented on a change in pull request #8205: [Relay][Convert Layout] Enable layout transformation for image.resize op

anijain2305 commented on a change in pull request #8205:
URL: https://github.com/apache/tvm/pull/8205#discussion_r646946445



##########
File path: python/tvm/relay/op/image/_image.py
##########
@@ -58,6 +58,38 @@ def compute_resize(attrs, inputs, out_type):
 reg.register_injective_schedule("image.resize")
 
 
+@reg.register_convert_op_layout("image.resize")
+def convert_image_resize(attrs, inputs, tinfos, desired_layouts):
+    """Convert Layout pass registration for image resize op.
+
+    Parameters
+    ----------
+    attrs : tvm.ir.Attrs
+        Attributes of current resize op
+    inputs : list of tvm.relay.Expr
+        The args of the Relay expr to be legalized
+    tinfos : list of types
+        List of input and output types
+    desired_layouts : list of layout strings
+        List of layouts defining our desired
+        layout for the data input.
+
+    Returns
+    -------
+    result : tvm.relay.Expr
+        The transformed expr
+    """
+    # pylint: disable=import-outside-toplevel
+    from tvm import relay

Review comment:
       I see. I might have copied it from some other place. @jtuyls Can you please check if you can move the import to the top (or just import the right module like `image` if the relay import fails).




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org