提交 3b915741 编写于 作者: B baojun 提交者: Tao Luo

Fix nGraph UT for PY3 - Part I (#21678)

* fix test for PY3 test=develop

* reduce file changes test=develop
上级 cb3763a8
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
from paddle.fluid.tests.unittests.test_accuracy_op import TestAccuracyOp sys.path.append("../")
from test_accuracy_op import TestAccuracyOp
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
sys.path.append("../")
import numpy as np import numpy as np
import paddle.fluid.core as core from op_test import OpTest
from paddle.fluid.tests.unittests.op_test import OpTest from test_activation_op import TestAbs, TestGelu, TestSigmoid, TestSquare, TestRelu, TestTanh
from paddle.fluid.tests.unittests.test_activation_op import TestAbs, TestGelu, TestSigmoid, TestSquare, TestRelu, TestTanh
class TestNGRAPHReluDim4(TestRelu): class TestNGRAPHReluDim4(TestRelu):
......
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
from paddle.fluid.tests.unittests.test_adam_op import TestAdamOp1, TestAdamOp2, TestAdamOpMultipleSteps, TestSparseAdamOp sys.path.append("../")
from test_adam_op import TestAdamOp1, TestAdamOp2, TestAdamOpMultipleSteps, TestSparseAdamOp
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()
...@@ -14,9 +14,10 @@ ...@@ -14,9 +14,10 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
from paddle.fluid.tests.unittests.test_batch_norm_op import TestBatchNormOpTraining, TestBatchNormOpInference sys.path.append("../")
from paddle.fluid.tests.unittests.op_test import _set_use_system_allocator from test_batch_norm_op import TestBatchNormOpTraining, TestBatchNormOpInference
from op_test import _set_use_system_allocator
_set_use_system_allocator(True) _set_use_system_allocator(True)
......
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
from paddle.fluid.tests.unittests.test_cast_op import TestCastOp1 sys.path.append("../")
from test_cast_op import TestCastOp1
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
from paddle.fluid.tests.unittests.test_concat_op import TestConcatOp, TestConcatOp2, TestConcatOp3, TestConcatOp4, TestConcatOp5 sys.path.append("../")
from test_concat_op import TestConcatOp, TestConcatOp2, TestConcatOp3, TestConcatOp4, TestConcatOp5
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
from paddle.fluid.tests.unittests.test_conv2d_op import TestConv2dOp, TestWithPad, TestWithStride, TestWithGroup, TestWith1x1, TestWithInput1x1Filter1x1, TestDepthwiseConv, TestDepthwiseConv2, TestDepthwiseConv3, TestDepthwiseConvWithDilation, TestDepthwiseConvWithDilation2 sys.path.append("../")
from test_conv2d_op import TestConv2dOp, TestWithPad, TestWithStride, TestWithGroup, TestWith1x1, TestWithInput1x1Filter1x1, TestDepthwiseConv, TestDepthwiseConv2, TestDepthwiseConv3, TestDepthwiseConvWithDilation, TestDepthwiseConvWithDilation2
class TestNGRAPHDepthwiseConv(TestDepthwiseConv): class TestNGRAPHDepthwiseConv(TestDepthwiseConv):
......
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
from paddle.fluid.tests.unittests.test_cross_entropy_op import TestCrossEntropyOp, TestCrossEntropyOp2, TestCrossEntropyOp3, TestCrossEntropyOp4, TestCrossEntropyOp5, TestCrossEntropyOp6, TestCrossEntropyOp7 sys.path.append("../")
from test_cross_entropy_op import TestCrossEntropyOp, TestCrossEntropyOp2, TestCrossEntropyOp3, TestCrossEntropyOp4, TestCrossEntropyOp5, TestCrossEntropyOp6, TestCrossEntropyOp7
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
from paddle.fluid.tests.unittests.test_dropout_op import TestDropoutOp, TestDropoutOp2, TestDropoutOp3, TestDropoutOp4, TestDropoutOp5, TestDropoutOp6, TestDropoutOp7, TestDropoutOp8, TestDropoutOp9 sys.path.append("../")
from test_dropout_op import TestDropoutOp, TestDropoutOp2, TestDropoutOp3, TestDropoutOp4, TestDropoutOp5, TestDropoutOp6, TestDropoutOp7, TestDropoutOp8, TestDropoutOp9
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
from paddle.fluid.tests.unittests.test_elementwise_add_op import TestElementwiseAddOp, TestElementwiseAddOp_broadcast_0 sys.path.append("../")
from test_elementwise_add_op import TestElementwiseAddOp, TestElementwiseAddOp_broadcast_0
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -14,9 +14,10 @@ ...@@ -14,9 +14,10 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
sys.path.append("../")
import numpy as np import numpy as np
from paddle.fluid.tests.unittests.test_fill_constant_op import TestFillConstantOp1, TestFillConstantOp2, TestFillConstantOpWithSelectedRows from test_fill_constant_op import TestFillConstantOp1, TestFillConstantOp2, TestFillConstantOpWithSelectedRows
class TestNGRAPHFillConstantFP64(TestFillConstantOp1): class TestNGRAPHFillConstantFP64(TestFillConstantOp1):
......
...@@ -13,8 +13,9 @@ ...@@ -13,8 +13,9 @@
# limitations under the License. # limitations under the License.
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
from paddle.fluid.tests.unittests.test_fill_zeros_like_op import TestFillZerosLikeOp sys.path.append("../")
from test_fill_zeros_like_op import TestFillZerosLikeOp
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()
...@@ -14,9 +14,10 @@ ...@@ -14,9 +14,10 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
sys.path.append("../")
import numpy as np import numpy as np
from paddle.fluid.tests.unittests.op_test import OpTest from op_test import OpTest
class TestNGRAPHIncrementOp(OpTest): class TestNGRAPHIncrementOp(OpTest):
......
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
from paddle.fluid.tests.unittests.test_lrn_op import TestLRNOp sys.path.append("../")
from test_lrn_op import TestLRNOp
class TestLRNNGRAPHOp(TestLRNOp): class TestLRNNGRAPHOp(TestLRNOp):
......
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
from paddle.fluid.tests.unittests.test_matmul_op import * sys.path.append("../")
from test_matmul_op import *
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -13,8 +13,9 @@ ...@@ -13,8 +13,9 @@
# limitations under the License. # limitations under the License.
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
from paddle.fluid.tests.unittests.test_mean_op import TestMeanOp sys.path.append("../")
from test_mean_op import TestMeanOp
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
from paddle.fluid.tests.unittests.test_momentum_op import TestMomentumOp1, TestMomentumOp2, TestLarsMomentumOp, TestSparseMomentumOp, TestSparseMomentumOp2 sys.path.append("../")
from test_momentum_op import TestMomentumOp1, TestMomentumOp2, TestLarsMomentumOp, TestSparseMomentumOp, TestSparseMomentumOp2
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
from paddle.fluid.tests.unittests.test_mul_op import TestMulOp, TestMulOp2 sys.path.append("../")
from test_mul_op import TestMulOp, TestMulOp2
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest, sys
sys.path.append("../")
from paddle.fluid.tests.unittests.test_pool2d_op import TestPool2D_Op, TestCase1, TestCase2, TestCase3, TestCase4, TestCase5 from test_pool2d_op import TestPool2D_Op, TestCase1, TestCase2, TestCase3, TestCase4, TestCase5
class TestNGRAPHCeilMode(TestCase1): class TestNGRAPHCeilMode(TestCase1):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册