tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] masahi commented on a change in pull request #5174: [Torch] Add support for split
Date Tue, 31 Mar 2020 06:17:24 GMT
masahi commented on a change in pull request #5174: [Torch] Add support for split
URL: https://github.com/apache/incubator-tvm/pull/5174#discussion_r400666996
 
 

 ##########
 File path: tests/python/frontend/pytorch/test_forward.py
 ##########
 @@ -379,6 +379,32 @@ def test_forward_maxpool1d():
                                     stride=2).eval(),
                 input_data)
 
+def test_forward_split():
+    torch.set_grad_enabled(False)
+    input_shape = [4, 10]
+
+    class Split1(Module):
+        def forward(self, *args):
+            return torch.split(args[0], 2, 0)
+
+    class Split2(Module):
+        def forward(self, *args):
+            return torch.split(args[0], [2, 3, 5], 1)
+
+    class Split3(Module):
+        def forward(self, *args):
+            return torch.split(args[0], 3, 1)
+
+    class Split4(Module):
+        def forward(self, *args):
+            return torch.split(args[0], 4, 1)
+
 
 Review comment:
   Rather than adding four classes, just add one class with constructor for its two arguments.

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


With regards,
Apache Git Services

Mime
View raw message