未验证 提交 63865c74 编写于 作者: iSerendipity's avatar iSerendipity 提交者: GitHub

[Test Mv] move mkldnn unittests to test dir (#51911)

* move mkldnn unittests to test dir

* add py_test_modules funcs

* move py_test_modules to test/mkldnn

* fix import error

* Revert "move py_test_modules to test/mkldnn"

This reverts commit 0277e0c29c22e5c29b7a3b843103f3d0b711c442.

* fix import error by conflicts

* fix errors

* fix mistake on solving conflicts
上级 a0069278
...@@ -850,10 +850,6 @@ if(WIN32) ...@@ -850,10 +850,6 @@ if(WIN32)
DEPS python) DEPS python)
endif() endif()
if(WITH_MKLDNN)
add_subdirectory(mkldnn)
endif()
add_subdirectory(ir) add_subdirectory(ir)
add_subdirectory(standalone_executor) add_subdirectory(standalone_executor)
......
...@@ -138,7 +138,9 @@ if(WITH_TESTING) ...@@ -138,7 +138,9 @@ if(WITH_TESTING)
endif() endif()
# add_subdirectory(ir) # add_subdirectory(ir)
add_subdirectory(legacy_test) add_subdirectory(legacy_test)
# add_subdirectory(mkldnn) if(WITH_MKLDNN)
add_subdirectory(mkldnn)
endif()
add_subdirectory(prim) add_subdirectory(prim)
# add_subdirectory(ps) # add_subdirectory(ps)
add_subdirectory(quantization) add_subdirectory(quantization)
......
...@@ -18,6 +18,10 @@ from functools import reduce ...@@ -18,6 +18,10 @@ from functools import reduce
from operator import mul from operator import mul
import numpy as np import numpy as np
from test_layer_norm_mkldnn_op import (
TestLayerNormMKLDNNOp,
_reference_layer_norm_naive,
)
from paddle import enable_static, fluid from paddle import enable_static, fluid
from paddle.fluid import core from paddle.fluid import core
...@@ -25,10 +29,6 @@ from paddle.fluid.tests.unittests.eager_op_test import ( ...@@ -25,10 +29,6 @@ from paddle.fluid.tests.unittests.eager_op_test import (
_set_use_system_allocator, _set_use_system_allocator,
convert_float_to_uint16, convert_float_to_uint16,
) )
from paddle.fluid.tests.unittests.mkldnn.test_layer_norm_mkldnn_op import (
TestLayerNormMKLDNNOp,
_reference_layer_norm_naive,
)
np.random.random(123) np.random.random(123)
......
...@@ -15,15 +15,7 @@ ...@@ -15,15 +15,7 @@
import unittest import unittest
import numpy as np import numpy as np
from test_matmul_mkldnn_op import (
import paddle
from paddle.fluid import core
from paddle.fluid.tests.unittests.eager_op_test import (
OpTest,
OpTestTool,
convert_float_to_uint16,
)
from paddle.fluid.tests.unittests.mkldnn.test_matmul_mkldnn_op import (
TestMatMulOpTransposeReshapeBasicFloat, TestMatMulOpTransposeReshapeBasicFloat,
TestMatMulOpTransposeReshapeEmptyFloat, TestMatMulOpTransposeReshapeEmptyFloat,
TestMatMulOpTransposeReshapeOtherDimFloat, TestMatMulOpTransposeReshapeOtherDimFloat,
...@@ -37,6 +29,14 @@ from paddle.fluid.tests.unittests.mkldnn.test_matmul_mkldnn_op import ( ...@@ -37,6 +29,14 @@ from paddle.fluid.tests.unittests.mkldnn.test_matmul_mkldnn_op import (
TestReshapeTransposeMatMulOp4DYFloat, TestReshapeTransposeMatMulOp4DYFloat,
) )
import paddle
from paddle.fluid import core
from paddle.fluid.tests.unittests.eager_op_test import (
OpTest,
OpTestTool,
convert_float_to_uint16,
)
def reference_matmul(X, Y, transpose_x=False, transpose_y=False): def reference_matmul(X, Y, transpose_x=False, transpose_y=False):
"""Reference forward implementation using np.matmul.""" """Reference forward implementation using np.matmul."""
......
...@@ -21,8 +21,12 @@ from paddle import enable_static ...@@ -21,8 +21,12 @@ from paddle import enable_static
from paddle.fluid import core from paddle.fluid import core
sys.path.append("..") sys.path.append("..")
from eager_op_test import OpTest, OpTestTool, convert_float_to_uint16 from paddle.fluid.tests.unittests.eager_op_test import (
from test_pool2d_op import ( OpTest,
OpTestTool,
convert_float_to_uint16,
)
from paddle.fluid.tests.unittests.test_pool2d_op import (
TestPool2D_Op_Mixin, TestPool2D_Op_Mixin,
adaptive_end_index, adaptive_end_index,
adaptive_start_index, adaptive_start_index,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册