From 5e29f30c942c867478bb299ee373913399a1e3d5 Mon Sep 17 00:00:00 2001 From: liulinduo <127399007+liulinduo@users.noreply.github.com> Date: Mon, 17 Apr 2023 15:45:14 +0800 Subject: [PATCH] [Test Mv] remove rnn (#52967) * [Test Mv] remove rnn * Update test_rnn_cell_api.py --- python/paddle/fluid/tests/unittests/CMakeLists.txt | 1 - python/paddle/fluid/tests/unittests/test_gru_rnn_op.py | 2 +- python/paddle/fluid/tests/unittests/test_rnn_cell_api.py | 7 +++++-- python/paddle/fluid/tests/unittests/test_rnn_op.py | 2 +- python/paddle/fluid/tests/unittests/test_simple_rnn_op.py | 6 +++--- test/CMakeLists.txt | 2 +- .../fluid/tests/unittests => test}/rnn/CMakeLists.txt | 0 .../paddle/fluid/tests/unittests => test}/rnn/__init__.py | 0 .../paddle/fluid/tests/unittests => test}/rnn/convert.py | 0 .../paddle/fluid/tests/unittests => test}/rnn/rnn_numpy.py | 0 .../fluid/tests/unittests => test}/rnn/test_rnn_api.py | 0 .../fluid/tests/unittests => test}/rnn/test_rnn_cells.py | 0 .../tests/unittests => test}/rnn/test_rnn_cells_static.py | 0 .../rnn/test_rnn_cudnn_params_packing.py | 0 .../fluid/tests/unittests => test}/rnn/test_rnn_nets.py | 0 .../tests/unittests => test}/rnn/test_rnn_nets_static.py | 0 .../fluid/tests/unittests => test}/rnn/test_wrappers.py | 0 17 files changed, 11 insertions(+), 9 deletions(-) rename {python/paddle/fluid/tests/unittests => test}/rnn/CMakeLists.txt (100%) rename {python/paddle/fluid/tests/unittests => test}/rnn/__init__.py (100%) rename {python/paddle/fluid/tests/unittests => test}/rnn/convert.py (100%) rename {python/paddle/fluid/tests/unittests => test}/rnn/rnn_numpy.py (100%) rename {python/paddle/fluid/tests/unittests => test}/rnn/test_rnn_api.py (100%) rename {python/paddle/fluid/tests/unittests => test}/rnn/test_rnn_cells.py (100%) rename {python/paddle/fluid/tests/unittests => test}/rnn/test_rnn_cells_static.py (100%) rename {python/paddle/fluid/tests/unittests => test}/rnn/test_rnn_cudnn_params_packing.py (100%) rename {python/paddle/fluid/tests/unittests => test}/rnn/test_rnn_nets.py (100%) mode change 100755 => 100644 rename {python/paddle/fluid/tests/unittests => test}/rnn/test_rnn_nets_static.py (100%) mode change 100755 => 100644 rename {python/paddle/fluid/tests/unittests => test}/rnn/test_wrappers.py (100%) mode change 100755 => 100644 diff --git a/python/paddle/fluid/tests/unittests/CMakeLists.txt b/python/paddle/fluid/tests/unittests/CMakeLists.txt index 0b0ca728aa9..57da05652eb 100755 --- a/python/paddle/fluid/tests/unittests/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/CMakeLists.txt @@ -769,7 +769,6 @@ if(NOT WIN32) endif() add_subdirectory(sequence) -add_subdirectory(rnn) add_subdirectory(distribution) # dist xpu tests: diff --git a/python/paddle/fluid/tests/unittests/test_gru_rnn_op.py b/python/paddle/fluid/tests/unittests/test_gru_rnn_op.py index 2aa68dfb16b..f68fc0d3c61 100644 --- a/python/paddle/fluid/tests/unittests/test_gru_rnn_op.py +++ b/python/paddle/fluid/tests/unittests/test_gru_rnn_op.py @@ -22,7 +22,7 @@ from eager_op_test import OpTest import paddle from paddle.fluid import core -sys.path.append("./rnn") +sys.path.append("../../../../../test/rnn") from convert import get_params_for_net from rnn_numpy import GRU diff --git a/python/paddle/fluid/tests/unittests/test_rnn_cell_api.py b/python/paddle/fluid/tests/unittests/test_rnn_cell_api.py index a7104e37399..0c82db42fed 100644 --- a/python/paddle/fluid/tests/unittests/test_rnn_cell_api.py +++ b/python/paddle/fluid/tests/unittests/test_rnn_cell_api.py @@ -12,12 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +import sys import unittest import numpy import numpy as np -from rnn.rnn_numpy import LSTMCell -from rnn.rnn_numpy import rnn as numpy_rnn + +sys.path.append("../../../../../test/rnn") +from rnn_numpy import LSTMCell +from rnn_numpy import rnn as numpy_rnn import paddle from paddle import fluid diff --git a/python/paddle/fluid/tests/unittests/test_rnn_op.py b/python/paddle/fluid/tests/unittests/test_rnn_op.py index e8c25f4b178..2160ffa2ecc 100644 --- a/python/paddle/fluid/tests/unittests/test_rnn_op.py +++ b/python/paddle/fluid/tests/unittests/test_rnn_op.py @@ -22,7 +22,7 @@ from eager_op_test import OpTest import paddle from paddle.fluid import core -sys.path.append("./rnn") +sys.path.append("../../../../../test/rnn") from convert import get_params_for_net from rnn_numpy import LSTM diff --git a/python/paddle/fluid/tests/unittests/test_simple_rnn_op.py b/python/paddle/fluid/tests/unittests/test_simple_rnn_op.py index 758c67036b0..20bd5081d05 100644 --- a/python/paddle/fluid/tests/unittests/test_simple_rnn_op.py +++ b/python/paddle/fluid/tests/unittests/test_simple_rnn_op.py @@ -22,9 +22,9 @@ from eager_op_test import OpTest import paddle from paddle.fluid import core -sys.path.append("./rnn") -from rnn.convert import get_params_for_net -from rnn.rnn_numpy import SimpleRNN +sys.path.append("../../../../../test/rnn") +from convert import get_params_for_net +from rnn_numpy import SimpleRNN random.seed(2) np.set_printoptions(threshold=np.inf) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7911a47ccfa..ae98ef60835 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -122,7 +122,7 @@ if(WITH_TESTING) add_subdirectory(prim) # add_subdirectory(ps) add_subdirectory(quantization) - # add_subdirectory(rnn) + add_subdirectory(rnn) add_subdirectory(rpc) # add_subdirectory(sequence) add_subdirectory(standalone_executor) diff --git a/python/paddle/fluid/tests/unittests/rnn/CMakeLists.txt b/test/rnn/CMakeLists.txt similarity index 100% rename from python/paddle/fluid/tests/unittests/rnn/CMakeLists.txt rename to test/rnn/CMakeLists.txt diff --git a/python/paddle/fluid/tests/unittests/rnn/__init__.py b/test/rnn/__init__.py similarity index 100% rename from python/paddle/fluid/tests/unittests/rnn/__init__.py rename to test/rnn/__init__.py diff --git a/python/paddle/fluid/tests/unittests/rnn/convert.py b/test/rnn/convert.py similarity index 100% rename from python/paddle/fluid/tests/unittests/rnn/convert.py rename to test/rnn/convert.py diff --git a/python/paddle/fluid/tests/unittests/rnn/rnn_numpy.py b/test/rnn/rnn_numpy.py similarity index 100% rename from python/paddle/fluid/tests/unittests/rnn/rnn_numpy.py rename to test/rnn/rnn_numpy.py diff --git a/python/paddle/fluid/tests/unittests/rnn/test_rnn_api.py b/test/rnn/test_rnn_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/rnn/test_rnn_api.py rename to test/rnn/test_rnn_api.py diff --git a/python/paddle/fluid/tests/unittests/rnn/test_rnn_cells.py b/test/rnn/test_rnn_cells.py similarity index 100% rename from python/paddle/fluid/tests/unittests/rnn/test_rnn_cells.py rename to test/rnn/test_rnn_cells.py diff --git a/python/paddle/fluid/tests/unittests/rnn/test_rnn_cells_static.py b/test/rnn/test_rnn_cells_static.py similarity index 100% rename from python/paddle/fluid/tests/unittests/rnn/test_rnn_cells_static.py rename to test/rnn/test_rnn_cells_static.py diff --git a/python/paddle/fluid/tests/unittests/rnn/test_rnn_cudnn_params_packing.py b/test/rnn/test_rnn_cudnn_params_packing.py similarity index 100% rename from python/paddle/fluid/tests/unittests/rnn/test_rnn_cudnn_params_packing.py rename to test/rnn/test_rnn_cudnn_params_packing.py diff --git a/python/paddle/fluid/tests/unittests/rnn/test_rnn_nets.py b/test/rnn/test_rnn_nets.py old mode 100755 new mode 100644 similarity index 100% rename from python/paddle/fluid/tests/unittests/rnn/test_rnn_nets.py rename to test/rnn/test_rnn_nets.py diff --git a/python/paddle/fluid/tests/unittests/rnn/test_rnn_nets_static.py b/test/rnn/test_rnn_nets_static.py old mode 100755 new mode 100644 similarity index 100% rename from python/paddle/fluid/tests/unittests/rnn/test_rnn_nets_static.py rename to test/rnn/test_rnn_nets_static.py diff --git a/python/paddle/fluid/tests/unittests/rnn/test_wrappers.py b/test/rnn/test_wrappers.py old mode 100755 new mode 100644 similarity index 100% rename from python/paddle/fluid/tests/unittests/rnn/test_wrappers.py rename to test/rnn/test_wrappers.py -- GitLab