提交 8439384e 编写于 作者: S songyouwei 提交者: Tao Luo

Move sequence op unittest files to a separate folder sequence (#21842)

* move sequence op unittests to a separate folder
test=develop

* add missing CMakeList file
test=develop

* fix relative path import
test=develop

* fix relative import
test=develop

* use sys.path.append
test=develop
上级 701189d5
......@@ -305,6 +305,8 @@ set_tests_properties(test_parallel_executor_seresnext_base_cpu PROPERTIES TIMEOU
set_tests_properties(test_parallel_executor_seresnext_with_reduce_cpu PROPERTIES TIMEOUT 750)
set_tests_properties(test_parallel_executor_seresnext_with_fuse_all_reduce_cpu PROPERTIES TIMEOUT 750)
add_subdirectory(sequence)
if (WITH_NGRAPH)
add_subdirectory(ngraph)
endif()
......
file(GLOB TEST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_*.py")
string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
foreach(TEST_OP ${TEST_OPS})
py_test_modules(${TEST_OP} MODULES ${TEST_OP})
endforeach(TEST_OP)
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
......@@ -17,6 +17,8 @@ from __future__ import print_function
import unittest
import numpy as np
import random
import sys
sys.path.append("../")
from op_test import OpTest
......
......@@ -16,6 +16,8 @@ from __future__ import print_function
import unittest
import numpy as np
import sys
sys.path.append("../")
from op_test import OpTest, skip_check_grad_ci
from test_reorder_lod_tensor import convert_to_offset
......
......@@ -16,6 +16,8 @@ from __future__ import print_function
import unittest
import numpy as np
import sys
sys.path.append("../")
from op_test import OpTest
......
......@@ -16,6 +16,8 @@ from __future__ import print_function
import unittest
import numpy as np
import sys
sys.path.append("../")
from op_test import OpTest
......
......@@ -16,6 +16,8 @@ from __future__ import print_function
import unittest
import numpy as np
import sys
sys.path.append("../")
from op_test import OpTest
......
......@@ -16,6 +16,8 @@ from __future__ import print_function
import unittest
import numpy as np
import sys
sys.path.append("../")
from op_test import OpTest
......
......@@ -16,6 +16,8 @@ from __future__ import print_function
import unittest
import numpy as np
import sys
sys.path.append("../")
from op_test import OpTest
......
......@@ -12,13 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from op_test import OpTest
import paddle.fluid as fluid
from paddle.fluid.framework import convert_np_dtype_to_dtype_
import paddle.fluid.core as core
import numpy as np
import copy
import unittest
import sys
sys.path.append("../")
from op_test import OpTest
class SequenceMaskTestBase(OpTest):
......
......@@ -14,6 +14,8 @@
import unittest
import numpy as np
import sys
sys.path.append("../")
from op_test import OpTest
......
......@@ -17,6 +17,8 @@ from __future__ import print_function
import unittest
import numpy as np
import math
import sys
sys.path.append("../")
from op_test import OpTest
......
......@@ -15,8 +15,10 @@
import unittest
import paddle.fluid as fluid
import paddle.fluid.core as core
from op_test import OpTest
import numpy as np
import sys
sys.path.append("../")
from op_test import OpTest
class TestSequenceReverseBase(OpTest):
......
......@@ -14,6 +14,8 @@
import unittest
import numpy as np
import sys
sys.path.append("../")
from op_test import OpTest
......
......@@ -17,6 +17,7 @@ from __future__ import print_function
import unittest
import numpy as np
import sys
sys.path.append("../")
from op_test import OpTest
......
......@@ -16,9 +16,11 @@ from __future__ import print_function
import unittest
import numpy as np
import paddle.fluid.core as core
import sys
sys.path.append("../")
from op_test import OpTest
from test_softmax_op import stable_softmax
import paddle.fluid.core as core
class TestSequenceSoftmaxOp(OpTest):
......
......@@ -16,8 +16,10 @@ from __future__ import print_function
import unittest
import numpy as np
from op_test import OpTest
from copy import deepcopy
import sys
sys.path.append("../")
from op_test import OpTest
class TestSequenceTopkAvgPoolingOp(OpTest):
......
......@@ -15,6 +15,8 @@
import unittest
import six
import numpy as np
import sys
sys.path.append("../")
from op_test import OpTest
......
......@@ -18,7 +18,7 @@ import unittest
import numpy as np
import random
from op_test import OpTest
from test_seq_conv import seqconv
from sequence.test_seq_conv import seqconv
class TestSeqConvEltAddRelu(OpTest):
......
......@@ -18,7 +18,7 @@ import unittest
import numpy as np
from op_test import OpTest
from test_reorder_lod_tensor import convert_to_offset
from test_seq_pool import compute_seqpool_sum, compute_seqpool_avg, compute_seqpool_sqrt
from sequence.test_seq_pool import compute_seqpool_sum, compute_seqpool_avg, compute_seqpool_sqrt
class TestFusionSeqPoolConcatOp(OpTest):
......
......@@ -18,7 +18,7 @@ import unittest
import numpy as np
from op_test import OpTest
from test_reorder_lod_tensor import convert_to_offset
from test_seq_pool import compute_seqpool_sum, compute_seqpool_avg, compute_seqpool_sqrt
from sequence.test_seq_pool import compute_seqpool_sum, compute_seqpool_avg, compute_seqpool_sqrt
from test_cvm_op import cvm_compute
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册