mbrookhart commented on a change in pull request #5983:
URL: https://github.com/apache/incubator-tvm/pull/5983#discussion_r450483728



##########
File path: python/tvm/relay/op/dyn/_transform.py
##########
@@ -81,3 +84,23 @@ def _reshape_shape_func_input_data(data, newshape, ndim):
 @_reg.register_shape_func("dyn.reshape", True)
 def dynamic_reshape_shape_func(attrs, inputs, out_ndims):
     return [_reshape_shape_func_input_data(*inputs, out_ndims[0])]
+
+
+@script
+def _tile_shape_func(data, reps, ndim):
+    out = output_tensor((ndim,), "int64")
+
+    for i in const_range(ndim):
+        out[i] = data.shape[i] * int64(reps[i])
+    return out
+
+
+@_reg.register_shape_func("dyn.tile", True)
+def tile_shape_func(attrs, inputs, _):
+    """
+    Shape function for tile op.
+    """
+    ndim = len(inputs[0].shape)
+    rdim = inputs[1].shape[0].value
+    assert ndim == rdim, "tile data and reps ranks don't match"

Review comment:
       I think I got it to work. I wasn't able to use the infrastructure from 
the static case directly, but it now implements the same API.




----------------------------------------------------------------
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:
[email protected]


Reply via email to