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

 ##########
 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:
   added more tests

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to