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 2020/07/13 17:38:57 UTC

[GitHub] [incubator-tvm] icemelon9 commented on a change in pull request #5955: Register Shape Func for Some Operators to Handle Dynamic Shapes

icemelon9 commented on a change in pull request #5955:
URL: https://github.com/apache/incubator-tvm/pull/5955#discussion_r453817936



##########
File path: python/tvm/relay/op/image/_image.py
##########
@@ -64,6 +67,22 @@ def compute_crop_and_resize(attrs, inputs, out_type):
 
 reg.register_injective_schedule("image.crop_and_resize")
 
+@script
+def _crop_and_resize_func(image_shape, boxes_shape, crop_size):
+    out = output_tensor((4,), "int64")
+    out[0] = boxes_shape[0]
+    out[1] = int64(crop_size[0])
+    out[2] = int64(crop_size[1])
+    out[3] = image_shape[3]
+
+    return out
+
+@reg.register_shape_func("image.crop_and_resize", False)
+def crop_and_resize_func(attrs, inputs, _):
+    crop_size = get_const_tuple(attrs.crop_size)

Review comment:
       You need to consider the image layout.




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