AndrewZhaoLuo commented on a change in pull request #9126:
URL: https://github.com/apache/tvm/pull/9126#discussion_r721756932



##########
File path: tests/python/frontend/paddlepaddle/test_forward.py
##########
@@ -623,39 +829,30 @@ def slice4(inputs):
 
 
 @tvm.testing.uses_gpu
-def test_forward_tanh():
-    @paddle.jit.to_static
-    def tanh(inputs):
-        return paddle.tanh(inputs)
+def test_forward_math_api():
+    class MathAPI(nn.Layer):
+        def __init__(self, api_name):
+            super(MathAPI, self).__init__()
+            for candidate in (paddle, paddle.nn.functional):
+                self.func = getattr(candidate, api_name, None)
+                if self.func:
+                    break
 
-    input_shape = [1, 3, 10, 10]
-    input_data = paddle.rand(input_shape, dtype="float32")
-    verify_model(tanh, input_data=input_data)
+        @paddle.jit.to_static
+        def forward(self, inputs):
+            return self.func(inputs)
+
+    api_list = [
+        "exp",
+        "relu",
+        "tanh",
+    ]
+    input_shapes = [[128], [2, 256], [1000, 128, 32], [7, 3, 256, 256]]

Review comment:
       Please reduce the size of your test cases to something smaller e.g. less 
than 256 total elements (totally arbitrary, just as small as possible while 
still accomplishing the 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to