tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] jwfromm commented on a change in pull request #5075: [Torch] Add initial 3D op support and test on Resnet 3D
Date Mon, 16 Mar 2020 20:55:20 GMT
jwfromm commented on a change in pull request #5075: [Torch] Add initial 3D op support and
test on Resnet 3D
URL: https://github.com/apache/incubator-tvm/pull/5075#discussion_r393303491
 
 

 ##########
 File path: tests/python/frontend/pytorch/test_forward.py
 ##########
 @@ -708,6 +701,31 @@ def forward(self, x):
     verify_model(ToInt().eval(), torch.tensor(2.0))
 
 
+def test_adaptive_pool3d():
+    inp = torch.rand((1, 32, 16, 16, 16))
+    verify_model(torch.nn.AdaptiveMaxPool3d((1, 1, 1)).eval(), inp)
+    verify_model(torch.nn.AdaptiveMaxPool3d((2, 2, 2)).eval(), inp)
+    verify_model(torch.nn.AdaptiveAvgPool3d((1, 1, 1)).eval(), inp)
+    verify_model(torch.nn.AdaptiveAvgPool3d((2, 2, 2)).eval(), inp)
+    verify_model(torch.nn.AdaptiveAvgPool3d((4, 8, 8)).eval(), inp)
+    verify_model(torch.nn.AdaptiveMaxPool3d((7, 8, 9)).eval(), inp)
+
+
+def test_conv3d():
+    inp = torch.rand((1, 32, 16, 16, 16))
+    verify_model(torch.nn.Conv3d(32, 16, (3, 3, 3),
+                                 padding=(1, 1, 1)).eval(),
+                 inp),
+    verify_model(torch.nn.Conv3d(32, 16, (5, 5, 5),
+                                 padding=(2, 2, 2)).eval(),
+                 inp),
+    verify_model(torch.nn.Conv3d(32, 16, kernel_size=1).eval(),
+                 inp)
+    # downsample
+    verify_model(torch.nn.Conv3d(32, 16, kernel_size=1, stride=2).eval(),
 
 Review comment:
   Probably worth adding one other input shape to test here as well.

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