delldu commented on a change in pull request #8443:
URL: https://github.com/apache/tvm/pull/8443#discussion_r667737287



##########
File path: python/tvm/relay/frontend/pytorch.py
##########
@@ -1875,7 +1875,9 @@ def Bool(self, inputs, input_types):
 
     def Float(self, inputs, input_types):
         assert len(inputs) == 1
-        return _op.cast(inputs[0], "float32")
+        if isinstance(inputs[0], _expr.Expr):
+            return inputs[0]
+        return float(inputs[0])

Review comment:
       OK, Previous implement is
    `return _op.cast(inputs[0], "float32")
   `
   If we set inputs[0] as a integer, for example 100, _op.cast(100, "float32") 
will crash. 
   we can do the same thing in test_forward with function convert_i, that is 
why we need think it as a bug.




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