masahi commented on a change in pull request #8709:
URL: https://github.com/apache/tvm/pull/8709#discussion_r697116285



##########
File path: python/tvm/relay/frontend/pytorch.py
##########
@@ -148,29 +146,13 @@ def infer_type(self, node, mod=None):
 
         if node in self.types:
             return self.types[node]
-        if isinstance(node, tvm.relay.Var):
-            return node.type_annotation
-
-        tf = _TypeFinder(types=self.types)
-        new_node = tf.visit(node)
-        fn = _function.Function(list(tf.vars.values()), new_node)
-        new_mod = IRModule({"main": fn})
-        if mod is not None:
-            new_mod.update(mod)
-        new_mod = transform.RemoveUnusedFunctions()(new_mod)
-        new_mod = transform.InferType()(new_mod)
-        entry = new_mod["main"]
-        ty = entry.body.checked_type
-        self.types[node] = ty
-        return self.types[node]

Review comment:
       I think removing this code would effectively revert the change in 
https://github.com/apache/tvm/pull/6900? That change was done for a good 
reason, so I think we should keep it.




-- 
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]


Reply via email to