提交 9fc13fde 编写于 作者: M minqiyang

Remove python3 relative import of unittest

上级 35e6abd7
...@@ -20,7 +20,7 @@ import itertools ...@@ -20,7 +20,7 @@ import itertools
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.core as core import paddle.fluid.core as core
from paddle.fluid.op import Operator from paddle.fluid.op import Operator
from .op_test import OpTest from op_test import OpTest
class BenchmarkSuite(OpTest): class BenchmarkSuite(OpTest):
......
...@@ -16,8 +16,8 @@ import unittest ...@@ -16,8 +16,8 @@ import unittest
import numpy as np import numpy as np
import paddle.fluid as fluid import paddle.fluid as fluid
from .benchmark import BenchmarkSuite from benchmark import BenchmarkSuite
from .op_test import OpTest from op_test import OpTest
# This is a demo op test case for operator benchmarking and high resolution number stability alignment. # This is a demo op test case for operator benchmarking and high resolution number stability alignment.
......
...@@ -25,7 +25,7 @@ from paddle.fluid.backward import append_backward ...@@ -25,7 +25,7 @@ from paddle.fluid.backward import append_backward
from paddle.fluid.op import Operator from paddle.fluid.op import Operator
from paddle.fluid.executor import Executor from paddle.fluid.executor import Executor
from paddle.fluid.framework import Program, OpProtoHolder, Variable from paddle.fluid.framework import Program, OpProtoHolder, Variable
from .testsuite import create_op, set_input, append_input_output, append_loss_ops from testsuite import create_op, set_input, append_input_output, append_loss_ops
from functools import reduce from functools import reduce
from six.moves import zip from six.moves import zip
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestAccuracyOp(OpTest): class TestAccuracyOp(OpTest):
......
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.fluid.core as core import paddle.fluid.core as core
from .op_test import OpTest from op_test import OpTest
from scipy.special import expit from scipy.special import expit
from .test_activation_op import TestRelu, TestTanh, TestSqrt, TestAbs from test_activation_op import TestRelu, TestTanh, TestSqrt, TestAbs
class TestMKLDNNReluDim2(TestRelu): class TestMKLDNNReluDim2(TestRelu):
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.fluid.core as core import paddle.fluid.core as core
from .op_test import OpTest from op_test import OpTest
from scipy.special import expit from scipy.special import expit
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestAdadeltaOp1(OpTest): class TestAdadeltaOp1(OpTest):
......
...@@ -16,7 +16,7 @@ import unittest ...@@ -16,7 +16,7 @@ import unittest
import numpy as np import numpy as np
import paddle.fluid.core as core import paddle.fluid.core as core
from paddle.fluid.op import Operator from paddle.fluid.op import Operator
from .op_test import OpTest from op_test import OpTest
import math import math
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
from paddle.fluid import core from paddle.fluid import core
from paddle.fluid.op import Operator from paddle.fluid.op import Operator
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestAdamaxOp1(OpTest): class TestAdamaxOp1(OpTest):
......
...@@ -16,7 +16,7 @@ import unittest ...@@ -16,7 +16,7 @@ import unittest
import numpy as np import numpy as np
import sys import sys
import math import math
from .op_test import OpTest from op_test import OpTest
def anchor_generator_in_python(input_feat, anchor_sizes, aspect_ratios, def anchor_generator_in_python(input_feat, anchor_sizes, aspect_ratios,
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class BaseTestCase(OpTest): class BaseTestCase(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestArgsortOp(OpTest): class TestArgsortOp(OpTest):
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from . import op_test import op_test
import numpy import numpy
import unittest import unittest
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.layers as layers import paddle.fluid.layers as layers
from . import op_test import op_test
import numpy import numpy
import unittest import unittest
import paddle.fluid.framework as framework import paddle.fluid.framework as framework
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
from paddle.fluid import metrics from paddle.fluid import metrics
......
...@@ -17,9 +17,9 @@ import numpy as np ...@@ -17,9 +17,9 @@ import numpy as np
import paddle.fluid.core as core import paddle.fluid.core as core
from paddle.fluid.op import Operator from paddle.fluid.op import Operator
import paddle.fluid as fluid import paddle.fluid as fluid
from .op_test import OpTest from op_test import OpTest
from paddle.fluid.framework import grad_var_name from paddle.fluid.framework import grad_var_name
from .test_batch_norm_op import TestBatchNormOpInference, TestBatchNormOpTraining, _reference_training, _reference_grad from test_batch_norm_op import TestBatchNormOpInference, TestBatchNormOpTraining, _reference_training, _reference_grad
class TestMKLDNNBatchNormOpTraining(TestBatchNormOpTraining): class TestMKLDNNBatchNormOpTraining(TestBatchNormOpTraining):
......
...@@ -17,7 +17,7 @@ import numpy as np ...@@ -17,7 +17,7 @@ import numpy as np
import paddle.fluid.core as core import paddle.fluid.core as core
from paddle.fluid.op import Operator from paddle.fluid.op import Operator
import paddle.fluid as fluid import paddle.fluid as fluid
from .op_test import OpTest from op_test import OpTest
from paddle.fluid.framework import grad_var_name from paddle.fluid.framework import grad_var_name
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
import paddle.fluid.core as core import paddle.fluid.core as core
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestBilinearTensorProductOp(OpTest): class TestBilinearTensorProductOp(OpTest):
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#limitations under the License. #limitations under the License.
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
def bipartite_match(distance, match_indices, match_dist): def bipartite_match(distance, match_indices, match_dist):
......
...@@ -16,7 +16,7 @@ import unittest ...@@ -16,7 +16,7 @@ import unittest
import numpy as np import numpy as np
import sys import sys
import math import math
from .op_test import OpTest from op_test import OpTest
def box_coder(target_box, prior_box, prior_box_var, output_box, code_type, def box_coder(target_box, prior_box, prior_box_var, output_box, code_type,
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from . import op_test import op_test
import unittest import unittest
import numpy as np import numpy as np
import paddle.fluid.core as core import paddle.fluid.core as core
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class Segment(object): class Segment(object):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestClipByNormOp(OpTest): class TestClipByNormOp(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestClipOp(OpTest): class TestClipOp(OpTest):
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from . import op_test import op_test
import unittest import unittest
import numpy import numpy
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestConcatOp(OpTest): class TestConcatOp(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
from .test_conv2d_op import TestConv2dOp, TestWithPad, TestWithStride from test_conv2d_op import TestConv2dOp, TestWithPad, TestWithStride
class TestMKLDNN(TestConv2dOp): class TestMKLDNN(TestConv2dOp):
......
...@@ -16,7 +16,7 @@ import unittest ...@@ -16,7 +16,7 @@ import unittest
import numpy as np import numpy as np
import paddle.fluid.core as core import paddle.fluid.core as core
from .op_test import OpTest from op_test import OpTest
def conv2d_forward_naive(input, filter, group, conv_param): def conv2d_forward_naive(input, filter, group, conv_param):
......
...@@ -16,7 +16,7 @@ import unittest ...@@ -16,7 +16,7 @@ import unittest
import numpy as np import numpy as np
import paddle.fluid.core as core import paddle.fluid.core as core
from .op_test import OpTest from op_test import OpTest
def conv2dtranspose_forward_naive(input_, filter_, attrs): def conv2dtranspose_forward_naive(input_, filter_, attrs):
......
...@@ -16,7 +16,7 @@ import unittest ...@@ -16,7 +16,7 @@ import unittest
import numpy as np import numpy as np
import paddle.fluid.core as core import paddle.fluid.core as core
from .op_test import OpTest from op_test import OpTest
def conv3d_forward_naive(input, filter, group, conv_param): def conv3d_forward_naive(input, filter, group, conv_param):
......
...@@ -16,7 +16,7 @@ import unittest ...@@ -16,7 +16,7 @@ import unittest
import numpy as np import numpy as np
import paddle.fluid.core as core import paddle.fluid.core as core
from .op_test import OpTest from op_test import OpTest
def conv3dtranspose_forward_naive(input_, filter_, attrs): def conv3dtranspose_forward_naive(input_, filter_, attrs):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
def conv_shift_forward(x, y): def conv_shift_forward(x, y):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestCosSimOp(OpTest): class TestCosSimOp(OpTest):
......
...@@ -16,7 +16,7 @@ import unittest ...@@ -16,7 +16,7 @@ import unittest
import random import random
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class CRFDecoding(object): class CRFDecoding(object):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
def crop(data, offsets, crop_shape): def crop(data, offsets, crop_shape):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest, randomize_probability from op_test import OpTest, randomize_probability
class TestCrossEntropyOp1(OpTest): class TestCrossEntropyOp1(OpTest):
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
import sys import sys
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
from .test_softmax_op import stable_softmax from test_softmax_op import stable_softmax
def CTCAlign(input, lod, blank, merge_repeated): def CTCAlign(input, lod, blank, merge_repeated):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestSumOp1(OpTest): class TestSumOp1(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestDecayedAdagradOp1(OpTest): class TestDecayedAdagradOp1(OpTest):
......
...@@ -17,7 +17,7 @@ import numpy as np ...@@ -17,7 +17,7 @@ import numpy as np
import sys import sys
import collections import collections
import math import math
from .op_test import OpTest from op_test import OpTest
class TestDetectionMAPOp(OpTest): class TestDetectionMAPOp(OpTest):
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.fluid.core as core import paddle.fluid.core as core
from .op_test import OpTest from op_test import OpTest
class TestDropoutOp(OpTest): class TestDropoutOp(OpTest):
......
...@@ -17,7 +17,7 @@ import random ...@@ -17,7 +17,7 @@ import random
import collections import collections
import paddle.fluid as fluid import paddle.fluid as fluid
import unittest import unittest
from .decorators import * from decorators import *
class Memory(object): class Memory(object):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
def Levenshtein(hyp, ref): def Levenshtein(hyp, ref):
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.fluid.core as core import paddle.fluid.core as core
from .op_test import OpTest from op_test import OpTest
from .test_elementwise_add_op import * from test_elementwise_add_op import *
''' '''
Some tests differ from the tests defined in test_elementwise_add_op.py Some tests differ from the tests defined in test_elementwise_add_op.py
because MKLDNN does not support tensors of number of dimensions 3. because MKLDNN does not support tensors of number of dimensions 3.
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.fluid.core as core import paddle.fluid.core as core
from .op_test import OpTest from op_test import OpTest
class TestElementwiseAddOp(OpTest): class TestElementwiseAddOp(OpTest):
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class ElementwiseDivOp(OpTest): class ElementwiseDivOp(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestElementwiseOp(OpTest): class TestElementwiseOp(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestElementwiseOp(OpTest): class TestElementwiseOp(OpTest):
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class ElementwiseMulOp(OpTest): class ElementwiseMulOp(OpTest):
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestElementwisePowOp(OpTest): class TestElementwisePowOp(OpTest):
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestElementwiseOp(OpTest): class TestElementwiseOp(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestExpandOpRank1(OpTest): class TestExpandOpRank1(OpTest):
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import unittest import unittest
import numpy as np import numpy as np
import math import math
from .op_test import OpTest from op_test import OpTest
def quantize_max_abs(x, num_bits): def quantize_max_abs(x, num_bits):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestFakeQuantizeOp(OpTest): class TestFakeQuantizeOp(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
def fully_connected_naive(input, weights, bias_data=None): def fully_connected_naive(input, weights, bias_data=None):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.fluid.layers as layers import paddle.fluid.layers as layers
from . import op_test import op_test
import numpy import numpy
import unittest import unittest
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestFillConstantBatchSizeLikeWhenFirstDimIsBatchSize(OpTest): class TestFillConstantBatchSizeLikeWhenFirstDimIsBatchSize(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestFillConstantOp1(OpTest): class TestFillConstantOp1(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
import paddle.fluid.core as core import paddle.fluid.core as core
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestFillZerosLikeOp(OpTest): class TestFillZerosLikeOp(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestFTRLOp(OpTest): class TestFTRLOp(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestGatherOp(OpTest): class TestGatherOp(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestGaussianRandomBatchSizeLike(OpTest): class TestGaussianRandomBatchSizeLike(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
from .test_gaussian_random_op import TestGaussianRandomOp from test_gaussian_random_op import TestGaussianRandomOp
class TestMKLDNN(TestGaussianRandomOp): class TestMKLDNN(TestGaussianRandomOp):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid.layers.device import get_places from paddle.fluid.layers.device import get_places
from . import decorators import decorators
import unittest import unittest
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
import unittest import unittest
import numpy as np import numpy as np
import math import math
from .op_test import OpTest from op_test import OpTest
from .test_lstm_op import identity, sigmoid, tanh, relu from test_lstm_op import identity, sigmoid, tanh, relu
class TestGRUOp(OpTest): class TestGRUOp(OpTest):
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import math import math
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class GRUActivationType(OpTest): class GRUActivationType(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestHingeLossOp(OpTest): class TestHingeLossOp(OpTest):
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import unittest import unittest
import numpy as np import numpy as np
import math import math
from .op_test import OpTest from op_test import OpTest
def find_latest_set(num): def find_latest_set(num):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
def huber_loss_forward(val, delta): def huber_loss_forward(val, delta):
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#limitations under the License. #limitations under the License.
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
def get_output_shape(attrs, in_shape, img_real_size): def get_output_shape(attrs, in_shape, img_real_size):
......
...@@ -17,7 +17,7 @@ import numpy as np ...@@ -17,7 +17,7 @@ import numpy as np
import numpy.random as random import numpy.random as random
import sys import sys
import math import math
from .op_test import OpTest from op_test import OpTest
class TestIOUSimilarityOp(OpTest): class TestIOUSimilarityOp(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestEmpty(OpTest): class TestEmpty(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import numpy as np import numpy as np
import unittest import unittest
from .op_test import OpTest from op_test import OpTest
class TestL1NormOp(OpTest): class TestL1NormOp(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestLabelSmoothOp(OpTest): class TestLabelSmoothOp(OpTest):
......
...@@ -20,7 +20,7 @@ from paddle.fluid.layers.device import get_places ...@@ -20,7 +20,7 @@ from paddle.fluid.layers.device import get_places
import paddle.fluid.nets as nets import paddle.fluid.nets as nets
from paddle.fluid.framework import Program, program_guard, default_main_program from paddle.fluid.framework import Program, program_guard, default_main_program
from paddle.fluid.param_attr import ParamAttr from paddle.fluid.param_attr import ParamAttr
from . import decorators import decorators
class TestBook(unittest.TestCase): class TestBook(unittest.TestCase):
......
...@@ -16,7 +16,7 @@ import unittest ...@@ -16,7 +16,7 @@ import unittest
import random import random
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class LinearChainCrfForward(object): class LinearChainCrfForward(object):
......
...@@ -20,7 +20,7 @@ import subprocess ...@@ -20,7 +20,7 @@ import subprocess
import time import time
import unittest import unittest
from multiprocessing import Process from multiprocessing import Process
from .op_test import OpTest from op_test import OpTest
def run_pserver(use_cuda, sync_mode, ip, port, trainers, trainer_id): def run_pserver(use_cuda, sync_mode, ip, port, trainers, trainer_id):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestLodResetOpByAttr(OpTest): class TestLodResetOpByAttr(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestLogLossOp(OpTest): class TestLogLossOp(OpTest):
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from . import op_test import op_test
import unittest import unittest
import numpy as np import numpy as np
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
import paddle.fluid.core as core import paddle.fluid.core as core
from paddle.fluid.op import Operator from paddle.fluid.op import Operator
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
import paddle.fluid.core as core import paddle.fluid.core as core
from paddle.fluid.op import Operator from paddle.fluid.op import Operator
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
from .test_lrn_op import TestLRNOp from test_lrn_op import TestLRNOp
class TestLRNMKLDNNOp(TestLRNOp): class TestLRNMKLDNNOp(TestLRNOp):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestLRNOp(OpTest): class TestLRNOp(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
SIGMOID_THRESHOLD_MIN = -40.0 SIGMOID_THRESHOLD_MIN = -40.0
SIGMOID_THRESHOLD_MAX = 13.0 SIGMOID_THRESHOLD_MAX = 13.0
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
def sigmoid_np(x): def sigmoid_np(x):
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#limitations under the License. #limitations under the License.
import unittest import unittest
import numpy as np import numpy as np
from . import test_lstm_op as LstmTest import test_lstm_op as LstmTest
ACTIVATION = { ACTIVATION = {
'identity': LstmTest.identity, 'identity': LstmTest.identity,
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestMarginRankLossOp(OpTest): class TestMarginRankLossOp(OpTest):
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
from . import decorators import decorators
import paddle.fluid as fluid import paddle.fluid as fluid
import numpy import numpy
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
def generate_compatible_shapes(dim_X, dim_Y, transpose_X, transpose_Y): def generate_compatible_shapes(dim_X, dim_Y, transpose_X, transpose_Y):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
def maxout_forward_naive(input, groups): def maxout_forward_naive(input, groups):
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
from __future__ import division from __future__ import division
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
def compute_mean_iou(predictions, labels, num_classes, in_wrongs, in_corrects, def compute_mean_iou(predictions, labels, num_classes, in_wrongs, in_corrects,
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestMeanOp(OpTest): class TestMeanOp(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestMergeIdsOp(OpTest): class TestMergeIdsOp(OpTest):
......
...@@ -16,7 +16,7 @@ import unittest ...@@ -16,7 +16,7 @@ import unittest
import numpy as np import numpy as np
import sys import sys
import math import math
from .op_test import OpTest from op_test import OpTest
class TestMineHardExamplesOp(OpTest): class TestMineHardExamplesOp(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
class TestMinusOp(OpTest): class TestMinusOp(OpTest):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import numpy as np import numpy as np
from .op_test import OpTest from op_test import OpTest
def modified_huber_loss_forward(val): def modified_huber_loss_forward(val):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册