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 19:37:07 UTC

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

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



##########
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:
       No, I just based this on other layout conversion functions and they seem to always lazy load inside the function: https://github.com/apache/tvm/blob/2c67d7131bc820481aaaca921f9e76f5709051b3/python/tvm/relay/op/nn/_nn.py#L240 Not sure why actually. 




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