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/09/13 02:45:57 UTC

[GitHub] [incubator-tvm] masahi commented on a change in pull request #6467: [ONNX] Update Slice op conversion to take strides into account, clean up tests

masahi commented on a change in pull request #6467:
URL: https://github.com/apache/incubator-tvm/pull/6467#discussion_r487472687



##########
File path: tests/python/frontend/onnx/test_forward.py
##########
@@ -681,6 +675,32 @@ def test_slice():
         x, x, starts=(0, 0), ends=(9223372036854775807, 9223372036854775807), axes=(0, 3)
     )
 
+    def test_slice_with_strides():
+        class SliceWithStrides(torch.nn.Module):
+            def forward(self, x):
+                return x[..., 0::2] + x[..., 1::2]
+
+        class SliceWithStrides2(torch.nn.Module):
+            def forward(self, x):
+                return x[0::2, 0::2] + x[1::2, 1::2]
+

Review comment:
       yeah, I did this way because the bug report https://github.com/apache/incubator-tvm/issues/6441 came with PyTorch code and I was too lazy to manually write equivalent onnx :) I'll update this to remove pytorch dep.




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