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



##########
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:
       If I revert this change back it kills the idea of the patch. But I agree 
with you. The best exit from this situation I'm seeing is to transfer approach 
from #6900 to common.py. I need a time to learn deeper the approach and think 
about general class managing of graph pass once and keeping results.
   My suggestion is to stop considering of the PR just now. I will try to bring 
more convinient functionality and keep current ones. I'll give you know when it 
will be ready




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