diff --git a/python/paddle/fluid/tests/unittests/CMakeLists.txt b/python/paddle/fluid/tests/unittests/CMakeLists.txt index 39739b742acc498da2bc18e49486d69d41914e18..406b8d5f55bc615bf97194b4a9c1321e00c4b250 100755 --- a/python/paddle/fluid/tests/unittests/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/CMakeLists.txt @@ -765,8 +765,6 @@ if(NOT WIN32) test_ir_memory_optimize_transformer) endif() -add_subdirectory(sequence) - # dist xpu tests: if(WITH_XPU_BKCL) py_test(test_collective_allreduce_api_xpu diff --git a/python/paddle/fluid/tests/unittests/test_fusion_seqconv_eltadd_relu_op.py b/python/paddle/fluid/tests/unittests/test_fusion_seqconv_eltadd_relu_op.py index 649f6afd0e55faa72ccec74ab9e28608eea6a5cd..673a709ec05cd342d15be4d8dff1b203d190fc67 100644 --- a/python/paddle/fluid/tests/unittests/test_fusion_seqconv_eltadd_relu_op.py +++ b/python/paddle/fluid/tests/unittests/test_fusion_seqconv_eltadd_relu_op.py @@ -12,11 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +import sys import unittest import numpy as np from eager_op_test import OpTest -from sequence.test_sequence_conv import seqconv + +sys.path.append("../../../../../test/sequence") +from test_sequence_conv import seqconv class TestSeqConvEltAddRelu(OpTest): diff --git a/python/paddle/fluid/tests/unittests/test_fusion_seqpool_concat_op.py b/python/paddle/fluid/tests/unittests/test_fusion_seqpool_concat_op.py index 56ce20a76c0d445406b6e214b971ec7b3cd1313a..e432500eecf17d03a392eb4df14587c4d1e065b9 100644 --- a/python/paddle/fluid/tests/unittests/test_fusion_seqpool_concat_op.py +++ b/python/paddle/fluid/tests/unittests/test_fusion_seqpool_concat_op.py @@ -12,11 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +import sys import unittest import numpy as np from eager_op_test import OpTest -from sequence.test_sequence_pool import ( + +sys.path.append("../../../../../test/sequence") +from test_sequence_pool import ( compute_seqpool_avg, compute_seqpool_sqrt, compute_seqpool_sum, diff --git a/python/paddle/fluid/tests/unittests/test_fusion_seqpool_cvm_concat_op.py b/python/paddle/fluid/tests/unittests/test_fusion_seqpool_cvm_concat_op.py index a5d2eb5c832786a2481d38e5b60ad8bdd67f4582..39b1f758b1454108f9d6ac62a7f60987230d1412 100644 --- a/python/paddle/fluid/tests/unittests/test_fusion_seqpool_cvm_concat_op.py +++ b/python/paddle/fluid/tests/unittests/test_fusion_seqpool_cvm_concat_op.py @@ -12,16 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. +import sys import unittest import numpy as np from eager_op_test import OpTest -from sequence.test_sequence_pool import ( + +sys.path.append("../../../../../test/sequence") +from test_cvm_op import cvm_compute +from test_sequence_pool import ( compute_seqpool_avg, compute_seqpool_sqrt, compute_seqpool_sum, ) -from test_cvm_op import cvm_compute def convert_to_offset(lod): diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7a5bfae6e206c12cef34cd4823ccd734b2760fc9..066875945a79cdb44516dba2a9e88ed9451be808 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -126,7 +126,7 @@ if(WITH_TESTING) add_subdirectory(quantization) add_subdirectory(rnn) add_subdirectory(rpc) - # add_subdirectory(sequence) + add_subdirectory(sequence) add_subdirectory(standalone_executor) add_subdirectory(tokenizer) # add_subdirectory(white_list) diff --git a/python/paddle/fluid/tests/unittests/sequence/CMakeLists.txt b/test/sequence/CMakeLists.txt similarity index 100% rename from python/paddle/fluid/tests/unittests/sequence/CMakeLists.txt rename to test/sequence/CMakeLists.txt diff --git a/python/paddle/fluid/tests/unittests/sequence/__init__.py b/test/sequence/__init__.py similarity index 100% rename from python/paddle/fluid/tests/unittests/sequence/__init__.py rename to test/sequence/__init__.py diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_concat.py b/test/sequence/test_sequence_concat.py similarity index 98% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_concat.py rename to test/sequence/test_sequence_concat.py index 1227fb0ba4b61a895c50042f4d9ed7925f906a6b..91e7df6f472850ee4df4dc4521631f80d0ee1d5a 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_concat.py +++ b/test/sequence/test_sequence_concat.py @@ -17,7 +17,7 @@ import unittest import numpy as np -sys.path.append("../") +sys.path.append("../../python/paddle/fluid/tests/unittests") from eager_op_test import OpTest import paddle diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_conv.py b/test/sequence/test_sequence_conv.py similarity index 99% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_conv.py rename to test/sequence/test_sequence_conv.py index 99d8cc5a9cc115d896737b5a1a0ca69be566ab58..74260ef7ba096940a95364a18a67a681432ce39b 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_conv.py +++ b/test/sequence/test_sequence_conv.py @@ -20,7 +20,7 @@ import numpy as np import paddle -sys.path.append("../") +sys.path.append("../../python/paddle/fluid/tests/unittests") from eager_op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_enumerate_op.py b/test/sequence/test_sequence_enumerate_op.py similarity index 98% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_enumerate_op.py rename to test/sequence/test_sequence_enumerate_op.py index 068eacb6e0fe1e281620b50818445c2ea240ea67..b17a14f47e191fad45534ae8d6ef642f96cc830c 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_enumerate_op.py +++ b/test/sequence/test_sequence_enumerate_op.py @@ -17,7 +17,7 @@ import unittest import numpy as np -sys.path.append("../") +sys.path.append("../../python/paddle/fluid/tests/unittests") from eager_op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_erase_op.py b/test/sequence/test_sequence_erase_op.py similarity index 98% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_erase_op.py rename to test/sequence/test_sequence_erase_op.py index 9aaecd1e0799c14ad99d5f52bdb6fbf13478d5b7..c43f377b761773e333de11349593c625ba76feba 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_erase_op.py +++ b/test/sequence/test_sequence_erase_op.py @@ -17,7 +17,7 @@ import unittest import numpy as np -sys.path.append("../") +sys.path.append("../../python/paddle/fluid/tests/unittests") from eager_op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_expand.py b/test/sequence/test_sequence_expand.py similarity index 98% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_expand.py rename to test/sequence/test_sequence_expand.py index 83291c78130d68d634d4e5f2f7638c8bc7c84b0c..8f6e86e49a846d850af2a7bb71552239c742d21b 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_expand.py +++ b/test/sequence/test_sequence_expand.py @@ -17,7 +17,7 @@ import unittest import numpy as np -sys.path.append("../") +sys.path.append("../../python/paddle/fluid/tests/unittests") from eager_op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_expand_as.py b/test/sequence/test_sequence_expand_as.py similarity index 98% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_expand_as.py rename to test/sequence/test_sequence_expand_as.py index 36704f61dcd972b98704fb188321fd6b7134c805..e00e393dc6b58be7c6319b8b0bc65fbb757b5620 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_expand_as.py +++ b/test/sequence/test_sequence_expand_as.py @@ -17,7 +17,7 @@ import unittest import numpy as np -sys.path.append("../") +sys.path.append("../../python/paddle/fluid/tests/unittests") from eager_op_test import OpTest import paddle diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_first_step.py b/test/sequence/test_sequence_first_step.py similarity index 100% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_first_step.py rename to test/sequence/test_sequence_first_step.py diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_last_step.py b/test/sequence/test_sequence_last_step.py similarity index 100% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_last_step.py rename to test/sequence/test_sequence_last_step.py diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_mask.py b/test/sequence/test_sequence_mask.py similarity index 98% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_mask.py rename to test/sequence/test_sequence_mask.py index 5e7c79ac0d66fa53a45ef847cb16b2422c783e87..0d2174d5dbc709ea998df002b2ccdfef9687c383 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_mask.py +++ b/test/sequence/test_sequence_mask.py @@ -24,7 +24,7 @@ from paddle.fluid.framework import ( program_guard, ) -sys.path.append("../") +sys.path.append("../../python/paddle/fluid/tests/unittests") from eager_op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_pad_op.py b/test/sequence/test_sequence_pad_op.py similarity index 99% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_pad_op.py rename to test/sequence/test_sequence_pad_op.py index 9bdaba6cbe88aebffe23c62dc9df045906556dff..66485c065aab7dde1a3d896dfb5415ffea474e7c 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_pad_op.py +++ b/test/sequence/test_sequence_pad_op.py @@ -17,7 +17,7 @@ import unittest import numpy as np -sys.path.append("../") +sys.path.append("../../python/paddle/fluid/tests/unittests") from eager_op_test import OpTest import paddle diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_pool.py b/test/sequence/test_sequence_pool.py similarity index 99% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_pool.py rename to test/sequence/test_sequence_pool.py index 5bbca01cdde04e7ab7cbfdccb198986d9afa1a66..a6f345dbcfe0a9e511930330dd74673f128b1679 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_pool.py +++ b/test/sequence/test_sequence_pool.py @@ -19,7 +19,7 @@ import numpy as np import paddle -sys.path.append("../") +sys.path.append("../../python/paddle/fluid/tests/unittests") from eager_op_test import OpTest, skip_check_grad_ci paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_reshape.py b/test/sequence/test_sequence_reshape.py similarity index 98% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_reshape.py rename to test/sequence/test_sequence_reshape.py index 4f6005d83c8f5643947c6f733464c65dd16d3953..cf4266982b376ba23d7cfa10ac5946fb7e0f687f 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_reshape.py +++ b/test/sequence/test_sequence_reshape.py @@ -19,7 +19,7 @@ import numpy as np import paddle -sys.path.append("../") +sys.path.append("../../python/paddle/fluid/tests/unittests") from eager_op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_reverse.py b/test/sequence/test_sequence_reverse.py similarity index 98% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_reverse.py rename to test/sequence/test_sequence_reverse.py index dfd532ad8d4fe4c7b9529e3ec3e4f149adeef267..46c28228e46b5f26ace4ea0487ae914d8467e6a0 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_reverse.py +++ b/test/sequence/test_sequence_reverse.py @@ -19,7 +19,7 @@ import numpy as np import paddle -sys.path.append("../") +sys.path.append("../../python/paddle/fluid/tests/unittests") from eager_op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_scatter_op.py b/test/sequence/test_sequence_scatter_op.py similarity index 97% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_scatter_op.py rename to test/sequence/test_sequence_scatter_op.py index 2f04dc81edfc1e16cfe76d44743d081735799b50..bc6341e6910a8fd9f05d982dbc1607d941d71fb5 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_scatter_op.py +++ b/test/sequence/test_sequence_scatter_op.py @@ -17,7 +17,7 @@ import unittest import numpy as np -sys.path.append("../") +sys.path.append("../../python/paddle/fluid/tests/unittests") from eager_op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_slice_op.py b/test/sequence/test_sequence_slice_op.py similarity index 97% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_slice_op.py rename to test/sequence/test_sequence_slice_op.py index 8ddbe8fb969329af6ed457fa9f20feb1cf084bc5..ded382d38c5ebe4d849acd86bf58ab5324d2b099 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_slice_op.py +++ b/test/sequence/test_sequence_slice_op.py @@ -17,7 +17,7 @@ import unittest import numpy as np -sys.path.append("../") +sys.path.append("../../python/paddle/fluid/tests/unittests") from eager_op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_softmax_op.py b/test/sequence/test_sequence_softmax_op.py similarity index 97% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_softmax_op.py rename to test/sequence/test_sequence_softmax_op.py index 4f088269bdca4101648d81b02a0f3511016aa2f2..400e4932b626094e6909137e76ecb7001c1f7aaa 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_softmax_op.py +++ b/test/sequence/test_sequence_softmax_op.py @@ -19,7 +19,7 @@ import numpy as np from paddle.fluid import core -sys.path.append("../") +sys.path.append("../../python/paddle/fluid/tests/unittests") from eager_op_test import OpTest from test_softmax_op import stable_softmax diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_topk_avg_pooling.py b/test/sequence/test_sequence_topk_avg_pooling.py similarity index 99% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_topk_avg_pooling.py rename to test/sequence/test_sequence_topk_avg_pooling.py index 4fcb20f1500fd091ca3098b0dbce423e75ae6781..98dcba0dfa578021ff1008c63d8b87b97d41aea4 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_topk_avg_pooling.py +++ b/test/sequence/test_sequence_topk_avg_pooling.py @@ -18,7 +18,7 @@ from copy import deepcopy import numpy as np -sys.path.append("../") +sys.path.append("../../python/paddle/fluid/tests/unittests") from eager_op_test import OpTest diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_unpad_op.py b/test/sequence/test_sequence_unpad_op.py similarity index 98% rename from python/paddle/fluid/tests/unittests/sequence/test_sequence_unpad_op.py rename to test/sequence/test_sequence_unpad_op.py index 4f2809635121d16d9d7f71c32480eb1127d1708f..133e4fae47b110a4afd0c2f3e8db44a23b497d9a 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_unpad_op.py +++ b/test/sequence/test_sequence_unpad_op.py @@ -17,7 +17,7 @@ import unittest import numpy as np -sys.path.append("../") +sys.path.append("../../python/paddle/fluid/tests/unittests") from eager_op_test import OpTest import paddle