jiangjiajun commented on a change in pull request #9126:
URL: https://github.com/apache/tvm/pull/9126#discussion_r718439340
##########
File path: tests/python/frontend/paddlepaddle/test_forward.py
##########
@@ -607,55 +960,53 @@ def slice4(inputs):
x1 = paddle.to_tensor([3]) + paddle.to_tensor([1])
return inputs[:, x0:, 1:x1, :]
- input_shape = [1, 3, 10, 10]
- input_data = paddle.rand(input_shape, dtype="float32")
- verify_model(
- slice1,
- input_data=[
- input_data,
- ],
- )
- verify_model(slice2, input_data=input_data)
- # need op "strided_slice"
- # verify_model(slice3, input_data=paddle.randn((4, 4)))
- # need op "assign_value"
- # verify_model(slice4, input_data=input_data)
-
-
[email protected]_gpu
-def test_forward_tanh():
@paddle.jit.to_static
- def tanh(inputs):
- return paddle.tanh(inputs)
+ def slice5(inputs):
+ x0 = paddle.to_tensor([3])
+ return inputs[:, 1::1, 2::x0, 4:10]
input_shape = [1, 3, 10, 10]
input_data = paddle.rand(input_shape, dtype="float32")
- verify_model(tanh, input_data=input_data)
+ end = paddle.to_tensor(np.array([3]))
+ verify_model(slice1, [input_data, end], input_shape=[[1, 3, 10, 10], [1]])
+ verify_model(slice2, input_data=input_data)
+ verify_model(slice3, input_data=paddle.randn((4, 4)))
+ verify_model(slice4, input_data=input_data)
+ verify_model(slice5, input_data=input_data)
if __name__ == "__main__":
test_forward_add_subtract()
Review comment:
Done
--
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]