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/03/15 19:49:52 UTC
[GitHub] [tvm] masahi commented on a change in pull request #10613: [Pytorch] Add `aten::fmod` and `aten::remainder`
masahi commented on a change in pull request #10613:
URL: https://github.com/apache/tvm/pull/10613#discussion_r827354667
##########
File path: tests/python/frontend/pytorch/test_forward.py
##########
@@ -361,6 +361,27 @@ def forward(self, *args):
verify_model(Multiply4().float().eval(), input_data=input_data)
+@tvm.testing.uses_gpu
+def test_forward_elemwise():
+ class FMod(Module):
+ def forward(self, *args):
+ return torch.fmod(*args)
+
+ class Remainder(Module):
+ def forward(self, *args):
+ return torch.remainder(*args)
+
+ input_data0 = torch.tensor([-3.0, -2, -1, 1, 2, 3])
+ input_data1 = torch.tensor(2)
+ verify_model(FMod(), input_data=[input_data0, input_data1])
+ verify_model(Remainder(), input_data=[input_data0, input_data1])
+
+ input_data0 = torch.tensor([1, 2, 3, 4, 5])
+ input_data1 = torch.tensor(-1.5)
+ verify_model(FMod(), input_data=[input_data0, input_data1])
+ verify_model(Remainder(), input_data=[input_data0, input_data1])
Review comment:
Please use this instead:
https://github.com/masahi/tvm/blob/76bb2a444acd89bafadb7cfba12f47fa40f8eb71/tests/python/frontend/pytorch/test_forward.py#L4208-L4219
--
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