You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/08/28 14:33:49 UTC

[GitHub] [incubator-tvm] leandron commented on a change in pull request #6357: [Torch] Add cast to double, fix flatten conversion

leandron commented on a change in pull request #6357:
URL: https://github.com/apache/incubator-tvm/pull/6357#discussion_r479344758



##########
File path: python/tvm/relay/frontend/pytorch.py
##########
@@ -996,12 +996,28 @@ def _impl(inputs, input_types):
         return _op.transform.transpose(data, axes)
     return _impl
 
+
 def _flatten():
     def _impl(inputs, input_types):
         data = inputs[0]
-        return _op.nn.batch_flatten(data)
+        start_dim = 0
+        end_dim = -1
+
+        if len(inputs) > 0:
+            start_dim = inputs[1]
+        if len(inputs) > 1:
+            end_dim = inputs[2]

Review comment:
       minor pythonic suggestion here: 
   ```
   start_dim = inputs[1] if len(inputs) > 0 else 0
   end_dim = inputs[2] if len(inputs) > 1 else -1
   ```




----------------------------------------------------------------
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:
users@infra.apache.org