From d99d1be55eac1429d18f3023e7c951b41a4ab099 Mon Sep 17 00:00:00 2001 From: sunzj Date: Sat, 9 Mar 2024 21:11:38 +0800 Subject: [PATCH] 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 49e9fc4495f93..e26e9bc7dc4ca 100644 --- a/python/tvm/relax/frontend/torch/fx_translator.py +++ b/python/tvm/relax/frontend/torch/fx_translator.py @@ -1561,7 +1561,7 @@ def from_fx( ), 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}"