haoyang9804 commented on code in PR #15683:
URL: https://github.com/apache/tvm/pull/15683#discussion_r1318267944
##########
python/tvm/relay/frontend/pytorch.py:
##########
@@ -4424,7 +4424,10 @@ def _create_typed_const(data, dtype):
dtype should be a TVM dtype"""
if dtype == "float64":
- typed_data = _expr.const(np.float64(data), dtype=dtype)
+ if len(data) == 1:
+ typed_data = _expr.const(np.array([np.float64(data)]), dtype=dtype)
+ else:
+ typed_data = _expr.const(np.float64(data), dtype=dtype)
Review Comment:
Hi Egor. I got a
[feedback](https://github.com/numpy/numpy/issues/24661#issuecomment-1709676592)
from Numpy community. Seems that using `np.float64` is not a wise decision
here. `np.asarray(..., dtype="float64")` is preferable here, advised by the
community.
--
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]