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 2022/02/08 01:28:44 UTC

[GitHub] [tvm] mei-ye commented on a change in pull request #10184: Support PyTorch grid_sample

mei-ye commented on a change in pull request #10184:
URL: https://github.com/apache/tvm/pull/10184#discussion_r801195057



##########
File path: tests/python/frontend/pytorch/test_forward.py
##########
@@ -4079,5 +4078,45 @@ def test_fn(m, v):
     verify_model(test_fn, [torch.randn(3, 8), torch.randn(8)])
 
 
+def test_grid_sample():
+    class Grid_sample_zeros(Module):
+        def forward(self, x, y):
+            return torch.nn.functional.grid_sample(
+                input=x, grid=y, mode="bilinear", padding_mode="zeros", align_corners=True
+            )
+
+    class Grid_sample_border(Module):
+        def forward(self, x, y):
+            return torch.nn.functional.grid_sample(
+                input=x, grid=y, mode="bilinear", padding_mode="border", align_corners=True
+            )
+
+    data = torch.rand([4, 4, 16, 32]).float()
+    grid = torch.rand([4, 8, 8, 2]).float()
+    verify_model(Grid_sample_zeros(), input_data=[data, grid])
+    verify_model(Grid_sample_border(), input_data=[data, grid])
+
+
+def test_list_tuple():
+    """test compilation error for a Python list followed by a prim::TupleConstruct."""

Review comment:
       There was a bug in PyTorch frontend on list of tuples.  And the bug is now already fixed upstream.  I removed my fix in this patch but decided to keep the unit test.




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

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org