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



##########
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:
       Done. I guess the limit on the number of elements is to reduce the cost 
time of testing?




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