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/06/13 01:10:15 UTC

[GitHub] [incubator-tvm] randxie commented on a change in pull request #5787: support aten::type_as in the pytorch frontend

randxie commented on a change in pull request #5787:
URL: https://github.com/apache/incubator-tvm/pull/5787#discussion_r439694860



##########
File path: tests/python/frontend/pytorch/test_forward.py
##########
@@ -836,6 +836,20 @@ def forward(self, *args):
     input_data = torch.rand(input_shape).float()
     verify_model(Size1().float().eval(), input_data=input_data)
 
+
+def test_type_as():
+    torch.set_grad_enabled(False)
+    input_shape = [1, 3]
+
+    class TypeAsInt32(Module):
+        def forward(self, *args):
+            int32_tensor = torch.zeros(1, 3, dtype=torch.int32)
+            return args[0].type_as(int32_tensor)

Review comment:
       Done. Did not realize the torch types and tvm type has different naming. Updated the test with more types covered.




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