You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2024/03/09 13:11:44 UTC
(tvm) branch main updated: Use target name instead of node name as function name (#16690)
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 ab5602607f Use target name instead of node name as function name (#16690)
ab5602607f is described below
commit ab5602607f890ca15202f69a2cc78633748d5743
Author: sunzj <ha...@gmail.com>
AuthorDate: Sat Mar 9 21:11:38 2024 +0800
Use target name instead of node name as function name (#16690)
torch change the description of the graph, function name isn't same as node name, cause can't find function. So use target name instead of node name.
---
python/tvm/relax/frontend/torch/fx_translator.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/tvm/relax/frontend/torch/fx_translator.py b/python/tvm/relax/frontend/torch/fx_translator.py
index 49e9fc4495..e26e9bc7dc 100644
--- a/python/tvm/relax/frontend/torch/fx_translator.py
+++ b/python/tvm/relax/frontend/torch/fx_translator.py
@@ -1561,7 +1561,7 @@ class TorchFXImporter:
), f"Unsupported module type {type(module)}"
self.env[node] = self.convert_map[type(module)](node)
elif node.op == "call_function":
- func_name = node.name.rstrip("0123456789_")
+ func_name = node.target.__name__
assert (
func_name in self.convert_map
), f"Unsupported function type {func_name}"