Hzfengsy commented on code in PR #15692:
URL: https://github.com/apache/tvm/pull/15692#discussion_r1319335324


##########
python/tvm/relax/frontend/onnx/onnx_frontend.py:
##########
@@ -1302,8 +1303,10 @@ def _impl_v18(cls, bb, inputs, attr, params):
         if scales is not None:
             assert isinstance(scales, relax.Constant), "Only constant scales 
currently supported."
             scales = scales.data.numpy()
-            sizes_shape = [dim.value for dim in x.struct_info.shape]
-            sizes = (sizes_shape * scales)[2:].astype("int64").tolist()
+            sizes = []
+            for i, dim in enumerate(x.struct_info.shape):
+                sizes.append(T.cast(scales[i] * dim, "int64"))

Review Comment:
   It would be great to use `tir.cast` instead of `T.cast` as the later one is 
designed for TVMScript for most cases



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