This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 44fac51d3c [Relax][ONNX] Replace deprecated 
`mapping.TENSOR_TYPE_TO_NP_TYPE` usage (#18016)
44fac51d3c is described below

commit 44fac51d3c05af12eda6233da5214e70c1f5278f
Author: Masahiro Hiramori <[email protected]>
AuthorDate: Wed May 28 04:42:44 2025 +0900

    [Relax][ONNX] Replace deprecated `mapping.TENSOR_TYPE_TO_NP_TYPE` usage 
(#18016)
    
    replace `mapping.TENSOR_TYPE_TO_NP_TYPE` with 
`helper.tensor_dtype_to_np_dtype`
---
 python/tvm/relax/frontend/onnx/onnx_frontend.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/python/tvm/relax/frontend/onnx/onnx_frontend.py 
b/python/tvm/relax/frontend/onnx/onnx_frontend.py
index f6bde18b8d..bae308f435 100644
--- a/python/tvm/relax/frontend/onnx/onnx_frontend.py
+++ b/python/tvm/relax/frontend/onnx/onnx_frontend.py
@@ -60,13 +60,13 @@ def get_type(elem_type: Union[str, int]) -> str:
         return elem_type
 
     try:
-        from onnx.mapping import (  # pylint: disable=import-outside-toplevel
-            TENSOR_TYPE_TO_NP_TYPE,
+        from onnx.helper import (  # pylint: disable=import-outside-toplevel
+            tensor_dtype_to_np_dtype,
         )
     except ImportError as exception:
         raise ImportError("Unable to import onnx which is required 
{}".format(exception))
 
-    return str(TENSOR_TYPE_TO_NP_TYPE[elem_type])
+    return str(tensor_dtype_to_np_dtype(elem_type))
 
 
 def get_constant(

Reply via email to