jwfromm commented on a change in pull request #4961: [Torch] Upsampling op 
support and enable registering a user defined op conversion map
URL: https://github.com/apache/incubator-tvm/pull/4961#discussion_r386006434
 
 

 ##########
 File path: python/tvm/relay/frontend/pytorch.py
 ##########
 @@ -614,6 +615,51 @@ def _impl(inputs, input_types):
         return _op.tensor.sqrt(data)
     return _impl
 
+def _floor():
+    def _impl(inputs, input_types):
+        data = inputs[0]
+        return _op.floor(data)
+    return _impl
+
+def _to():
+    def _impl(inputs, input_types):
+        data = inputs[0]
+        # special handling for aten::to(data, 6, _, _, _) case
+        # 6 means dtype = float
+        # this happens when converting upsampling with scale factor
+        cast_func = {
+            6: float,
+        }
+        if inputs[1] in cast_func and not isinstance(data, _expr.Expr):
 
 Review comment:
   Ah I didn't know it was overloaded for device copies. This does look much 
better though, thanks!

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to