You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by sy...@apache.org on 2025/04/04 09:20:34 UTC

(tvm) branch main updated: [Relax][PyTorch] Delete duplicate converter function `_to` (#17809)

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

syfeng 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 1bf342313a [Relax][PyTorch] Delete duplicate converter function `_to` (#17809)
1bf342313a is described below

commit 1bf342313a9395950635db56b9c387e633e8363a
Author: Masahiro Hiramori <Hi...@ct.MitsubishiElectric.co.jp>
AuthorDate: Fri Apr 4 18:20:29 2025 +0900

    [Relax][PyTorch] Delete duplicate converter function `_to` (#17809)
    
    remove duplicate function
---
 python/tvm/relax/frontend/torch/fx_translator.py | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/python/tvm/relax/frontend/torch/fx_translator.py b/python/tvm/relax/frontend/torch/fx_translator.py
index e79c1dbc48..0b649eb755 100644
--- a/python/tvm/relax/frontend/torch/fx_translator.py
+++ b/python/tvm/relax/frontend/torch/fx_translator.py
@@ -563,19 +563,6 @@ class TorchFXImporter(BaseFXGraphImporter):
             x.struct_info.dtype in ["float16", "float32", "float64", "bfloat16"], "bool"
         )
 
-    def _to(self, node: fx.Node) -> relax.Var:
-        import torch
-
-        x = self.env[node.args[0]]
-        if len(node.args) == 2:
-            if isinstance(node.args[1], torch.dtype):
-                dtype = TorchFXImporter._convert_data_type(node.args[1], self.env)
-                return self.block_builder.emit(relax.op.astype(x, dtype))
-        elif "dtype" in node.kwargs:
-            dtype = TorchFXImporter._convert_data_type(node.kwargs["dtype"], self.env)
-            return self.block_builder.emit(relax.op.astype(x, dtype))
-        return x
-
     def _type(self, node: fx.Node) -> relax.Var:
         x = self.env[node.args[0]]
         dtype = TorchFXImporter._convert_data_type(node.args[1], self.env)