提交 bde090a9 编写于 作者: L Luo Tao

replace paddle.v2.fluid by paddle.fluid in tests

上级 f7fa7c57
...@@ -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 paddle.v2.fluid import framework as framework from paddle.fluid import framework as framework
from . import core from . import core
import collections import collections
import copy import copy
......
...@@ -26,7 +26,7 @@ A `scoped_function` will take a `function` as input. That function will be ...@@ -26,7 +26,7 @@ A `scoped_function` will take a `function` as input. That function will be
invoked in a new local scope. invoked in a new local scope.
""" """
import paddle.v2.fluid.core import paddle.fluid.core
import threading import threading
__tl_scope__ = threading.local() __tl_scope__ = threading.local()
...@@ -44,13 +44,13 @@ __all__ = [ ...@@ -44,13 +44,13 @@ __all__ = [
def get_cur_scope(): def get_cur_scope():
""" """
Get current scope. Get current scope.
:rtype: paddle.v2.fluid.core.Scope :rtype: paddle.fluid.core.Scope
""" """
cur_scope_stack = getattr(__tl_scope__, 'cur_scope', None) cur_scope_stack = getattr(__tl_scope__, 'cur_scope', None)
if cur_scope_stack is None: if cur_scope_stack is None:
__tl_scope__.cur_scope = list() __tl_scope__.cur_scope = list()
if len(__tl_scope__.cur_scope) == 0: if len(__tl_scope__.cur_scope) == 0:
__tl_scope__.cur_scope.append(paddle.v2.fluid.core.Scope()) __tl_scope__.cur_scope.append(paddle.fluid.core.Scope())
return __tl_scope__.cur_scope[-1] return __tl_scope__.cur_scope[-1]
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
import os import os
from paddle.v2.fluid.evaluator import Evaluator from paddle.fluid.evaluator import Evaluator
from paddle.v2.fluid.framework import Program, Parameter, default_main_program, Variable from paddle.fluid.framework import Program, Parameter, default_main_program, Variable
from . import core from . import core
__all__ = [ __all__ = [
......
...@@ -17,7 +17,7 @@ import itertools ...@@ -17,7 +17,7 @@ import itertools
from framework import Variable, Parameter, default_main_program, default_startup_program, dtype_is_floating from framework import Variable, Parameter, default_main_program, default_startup_program, dtype_is_floating
import unique_name import unique_name
from paddle.v2.fluid.initializer import Constant, Xavier from paddle.fluid.initializer import Constant, Xavier
from param_attr import ParamAttr, WeightNormParamAttr from param_attr import ParamAttr, WeightNormParamAttr
......
...@@ -17,8 +17,8 @@ import json ...@@ -17,8 +17,8 @@ import json
import logging import logging
from collections import defaultdict from collections import defaultdict
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import paddle.v2.fluid.proto.framework_pb2 as framework_pb2 import paddle.fluid.proto.framework_pb2 as framework_pb2
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
# 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.
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import paddle.v2.fluid.proto.framework_pb2 as framework_pb2 import paddle.fluid.proto.framework_pb2 as framework_pb2
def get_all_op_protos(): def get_all_op_protos():
......
...@@ -14,15 +14,15 @@ ...@@ -14,15 +14,15 @@
import numpy as np import numpy as np
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import paddle.v2.fluid.framework as framework import paddle.fluid.framework as framework
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
import contextlib import contextlib
import math import math
import sys import sys
import unittest import unittest
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
dict_size = 30000 dict_size = 30000
source_dict_dim = target_dict_dim = dict_size source_dict_dim = target_dict_dim = dict_size
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import contextlib import contextlib
import numpy import numpy
import unittest import unittest
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
from __future__ import print_function from __future__ import print_function
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import contextlib import contextlib
import math import math
import sys import sys
......
...@@ -17,8 +17,8 @@ import math ...@@ -17,8 +17,8 @@ import math
import numpy as np import numpy as np
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.dataset.conll05 as conll05 import paddle.v2.dataset.conll05 as conll05
import paddle.v2.fluid as fluid import paddle.fluid as fluid
from paddle.v2.fluid.initializer import init_on_cpu from paddle.fluid.initializer import init_on_cpu
import contextlib import contextlib
import time import time
import unittest import unittest
......
...@@ -15,10 +15,10 @@ import contextlib ...@@ -15,10 +15,10 @@ import contextlib
import numpy as np import numpy as np
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.framework as framework import paddle.fluid.framework as framework
import paddle.v2.fluid.layers as pd import paddle.fluid.layers as pd
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
import unittest import unittest
dict_size = 30000 dict_size = 30000
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
from __future__ import print_function from __future__ import print_function
import argparse import argparse
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2 as paddle import paddle.v2 as paddle
import sys import sys
import numpy import numpy
......
...@@ -16,12 +16,12 @@ import math ...@@ -16,12 +16,12 @@ import math
import sys import sys
import numpy as np import numpy as np
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.framework as framework import paddle.fluid.framework as framework
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
import paddle.v2.fluid.nets as nets import paddle.fluid.nets as nets
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
from paddle.v2.fluid.optimizer import SGDOptimizer from paddle.fluid.optimizer import SGDOptimizer
IS_SPARSE = True IS_SPARSE = True
USE_GPU = False USE_GPU = False
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2 as paddle import paddle.v2 as paddle
import contextlib import contextlib
import math import math
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# limitations under the License. # limitations under the License.
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import unittest import unittest
import os import os
import numpy as np import numpy as np
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import numpy as np import numpy as np
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import os import os
x = fluid.layers.data(name='x', shape=[13], dtype='float32') x = fluid.layers.data(name='x', shape=[13], dtype='float32')
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
from __future__ import print_function from __future__ import print_function
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import os import os
import sys import sys
......
...@@ -17,7 +17,7 @@ import math ...@@ -17,7 +17,7 @@ import math
import numpy as np import numpy as np
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.dataset.conll05 as conll05 import paddle.v2.dataset.conll05 as conll05
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import time import time
import os import os
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
from __future__ import print_function from __future__ import print_function
import numpy as np import numpy as np
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import os import os
PASS_NUM = 100 PASS_NUM = 100
......
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
import numpy as np import numpy as np
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import paddle.v2.fluid.framework as framework import paddle.fluid.framework as framework
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
import os import os
dict_size = 30000 dict_size = 30000
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
from __future__ import print_function from __future__ import print_function
import numpy as np import numpy as np
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import os import os
images = fluid.layers.data(name='pixel', shape=[1, 28, 28], dtype='float32') images = fluid.layers.data(name='pixel', shape=[1, 28, 28], dtype='float32')
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
from __future__ import print_function from __future__ import print_function
import numpy as np import numpy as np
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import os import os
BATCH_SIZE = 128 BATCH_SIZE = 128
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
import numpy as np import numpy as np
import os import os
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
import paddle.v2.fluid.nets as nets import paddle.fluid.nets as nets
from paddle.v2.fluid.optimizer import SGDOptimizer from paddle.fluid.optimizer import SGDOptimizer
IS_SPARSE = True IS_SPARSE = True
BATCH_SIZE = 256 BATCH_SIZE = 256
......
...@@ -16,7 +16,7 @@ from __future__ import print_function ...@@ -16,7 +16,7 @@ from __future__ import print_function
import os import os
import numpy as np import numpy as np
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
def convolution_net(data, label, input_dim, class_dim=2, emb_dim=32, def convolution_net(data, label, input_dim, class_dim=2, emb_dim=32,
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import numpy as np import numpy as np
import os import os
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
def stacked_lstm_net(data, def stacked_lstm_net(data,
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import numpy as np import numpy as np
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import math import math
import sys import sys
......
...@@ -17,7 +17,7 @@ from __future__ import print_function ...@@ -17,7 +17,7 @@ from __future__ import print_function
import sys import sys
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import math import math
import sys import sys
......
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
import numpy as np import numpy as np
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import paddle.v2.fluid.framework as framework import paddle.fluid.framework as framework
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
import math import math
import sys import sys
......
...@@ -20,7 +20,7 @@ import matplotlib ...@@ -20,7 +20,7 @@ import matplotlib
import numpy import numpy
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
matplotlib.use('Agg') matplotlib.use('Agg')
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
class TestRoutineOp(unittest.TestCase): class TestRoutineOp(unittest.TestCase):
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle.v2.fluid as fluid import paddle.fluid as fluid
class TestCSPFramework(unittest.TestCase): class TestCSPFramework(unittest.TestCase):
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import numpy as np import numpy as np
prog = fluid.framework.Program() prog = fluid.framework.Program()
......
...@@ -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.
import paddle.v2.fluid as fluid import paddle.fluid as fluid
def test_converter(): def test_converter():
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
# limitations under the License. # limitations under the License.
from __future__ import print_function from __future__ import print_function
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
from paddle.v2.fluid.framework import Program, program_guard from paddle.fluid.framework import Program, program_guard
import unittest import unittest
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
from __future__ import print_function from __future__ import print_function
import numpy as np import numpy as np
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
BATCH_SIZE = 128 BATCH_SIZE = 128
CLIP_MAX = 2e-6 CLIP_MAX = 2e-6
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import numpy as np import numpy as np
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid as fluid import paddle.fluid as fluid
BATCH_SIZE = 128 BATCH_SIZE = 128
CLIP = 1 CLIP = 1
......
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
# 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.
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
from paddle.v2.fluid.framework import Program, program_guard, default_main_program, default_startup_program from paddle.fluid.framework import Program, program_guard, default_main_program, default_startup_program
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
from paddle.v2.fluid.optimizer import MomentumOptimizer from paddle.fluid.optimizer import MomentumOptimizer
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import paddle.v2 as paddle import paddle.v2 as paddle
import unittest import unittest
import numpy as np import numpy as np
......
...@@ -16,9 +16,9 @@ import unittest ...@@ -16,9 +16,9 @@ import unittest
import numpy as np import numpy as np
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
import paddle.v2.fluid.framework as framework import paddle.fluid.framework as framework
import paddle.v2.fluid as fluid import paddle.fluid as fluid
class TestPythonOperatorOverride(unittest.TestCase): class TestPythonOperatorOverride(unittest.TestCase):
......
...@@ -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.
import paddle.v2.fluid as fluid import paddle.fluid as fluid
__all__ = ['many_times', 'prog_scope'] __all__ = ['many_times', 'prog_scope']
......
...@@ -16,12 +16,12 @@ import unittest ...@@ -16,12 +16,12 @@ import unittest
import numpy as np import numpy as np
import random import random
import itertools import itertools
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import collections import collections
from paddle.v2.fluid.backward import append_backward from paddle.fluid.backward import append_backward
from paddle.v2.fluid.op import Operator from paddle.fluid.op import Operator
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
from paddle.v2.fluid.framework import Program, OpProtoHolder from paddle.fluid.framework import Program, OpProtoHolder
def randomize_probability(batch_size, class_num, dtype='float32'): def randomize_probability(batch_size, class_num, dtype='float32'):
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from paddle.v2.fluid.op import Operator from paddle.fluid.op import Operator
from op_test import OpTest from op_test import OpTest
import math import math
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
import unittest import unittest
import numpy as np import numpy as np
from op_test import OpTest from op_test import OpTest
from paddle.v2.fluid import core from paddle.fluid import core
from paddle.v2.fluid.op import Operator from paddle.fluid.op import Operator
class TestAdamOp1(OpTest): class TestAdamOp1(OpTest):
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
from paddle.v2.fluid.backward import append_backward from paddle.fluid.backward import append_backward
from paddle.v2.fluid.framework import default_main_program from paddle.fluid.framework import default_main_program
import numpy import numpy
......
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
# 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.
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
import op_test import op_test
import numpy import numpy
import unittest import unittest
import paddle.v2.fluid.framework as framework import paddle.fluid.framework as framework
class TestAssignValueOp(op_test.OpTest): class TestAssignValueOp(op_test.OpTest):
......
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
import unittest import unittest
import numpy as np import numpy as np
from op_test import OpTest from op_test import OpTest
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from paddle.v2.fluid.op import Operator from paddle.fluid.op import Operator
from paddle.v2.fluid.framework import grad_var_name from paddle.fluid.framework import grad_var_name
def get_backward_op(scope, op, no_grad_set): def get_backward_op(scope, op, no_grad_set):
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from paddle.v2.fluid.op import Operator from paddle.fluid.op import Operator
class TestBeamSearchDecodeOp(unittest.TestCase): class TestBeamSearchDecodeOp(unittest.TestCase):
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
# limitations under the License. # limitations under the License.
import logging import logging
from paddle.v2.fluid.op import Operator, DynamicRecurrentOp from paddle.fluid.op import Operator, DynamicRecurrentOp
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import unittest import unittest
import numpy as np import numpy as np
......
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
import unittest import unittest
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
import paddle.v2.fluid.framework as framework import paddle.fluid.framework as framework
import paddle.v2.fluid.optimizer as optimizer import paddle.fluid.optimizer as optimizer
from paddle.v2.fluid.backward import calc_gradient from paddle.fluid.backward import calc_gradient
class TestCalcGradient(unittest.TestCase): class TestCalcGradient(unittest.TestCase):
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import op_test import op_test
import unittest import unittest
import numpy as np import numpy as np
import paddle.v2.fluid.core as core import paddle.fluid.core as core
class TestCastOp(op_test.OpTest): class TestCastOp(op_test.OpTest):
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
# limitations under the License. # limitations under the License.
import logging import logging
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import unittest import unittest
import numpy as np import numpy as np
from paddle.v2.fluid.op import Operator, CondOp from paddle.fluid.op import Operator, CondOp
class PySimpleCond(object): class PySimpleCond(object):
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from paddle.v2.fluid.framework import default_startup_program, default_main_program from paddle.fluid.framework import default_startup_program, default_main_program
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
from paddle.v2.fluid.backward import append_backward from paddle.fluid.backward import append_backward
import numpy import numpy
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle.v2.fluid.framework as framework import paddle.fluid.framework as framework
class ConditionalBlock(unittest.TestCase): class ConditionalBlock(unittest.TestCase):
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from op_test import OpTest from op_test import OpTest
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from op_test import OpTest from op_test import OpTest
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from op_test import OpTest from op_test import OpTest
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from op_test import OpTest from op_test import OpTest
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
class TestDocString(unittest.TestCase): class TestDocString(unittest.TestCase):
......
...@@ -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 paddle.v2.fluid.default_scope_funcs import * from paddle.fluid.default_scope_funcs import *
import unittest import unittest
......
...@@ -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.
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2 as paddle import paddle.v2 as paddle
import unittest import unittest
import numpy import numpy
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import numpy import numpy
import random import random
import collections import collections
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import unittest import unittest
from decorators import * from decorators import *
......
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
import unittest import unittest
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import paddle.v2.fluid as fluid import paddle.fluid as fluid
from paddle.v2.fluid.backward import append_backward from paddle.fluid.backward import append_backward
import paddle.v2.fluid.framework as framework import paddle.fluid.framework as framework
from paddle.v2.fluid.framework import Program, switch_main_program from paddle.fluid.framework import Program, switch_main_program
import bisect import bisect
import numpy as np import numpy as np
......
...@@ -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.
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import unittest import unittest
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
import unittest import unittest
import numpy import numpy
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
from paddle.v2.fluid.layers import mul, data from paddle.fluid.layers import mul, data
class TestExecutor(unittest.TestCase): class TestExecutor(unittest.TestCase):
......
...@@ -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.
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import unittest import unittest
import numpy as np import numpy as np
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
# 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.
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
import op_test import op_test
import numpy import numpy
import unittest import unittest
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,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.v2.fluid.core as core import paddle.fluid.core as core
class TestFillOp(OpTest): class TestFillOp(OpTest):
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
from paddle.v2.fluid.framework import Program from paddle.fluid.framework import Program
class TestDebugStringFramework(unittest.TestCase): class TestDebugStringFramework(unittest.TestCase):
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
import unittest import unittest
import numpy import numpy
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from paddle.v2.fluid.op import Operator from paddle.fluid.op import Operator
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
class TestGaussianRandomOp(unittest.TestCase): class TestGaussianRandomOp(unittest.TestCase):
......
...@@ -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.
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import decorators import decorators
import unittest import unittest
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
import unittest import unittest
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.nets as nets import paddle.fluid.nets as nets
from paddle.v2.fluid.framework import Program from paddle.fluid.framework import Program
def conv_block(input, num_filter, groups, dropouts): def conv_block(input, num_filter, groups, dropouts):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import paddle.v2.fluid.core as core import paddle.fluid.core as core
class TestInferShape(unittest.TestCase): class TestInferShape(unittest.TestCase):
......
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import paddle.v2.fluid.executor as executor import paddle.fluid.executor as executor
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
import paddle.v2.fluid.optimizer as optimizer import paddle.fluid.optimizer as optimizer
from paddle.v2.fluid.framework import Program, program_guard from paddle.fluid.framework import Program, program_guard
from paddle.v2.fluid.io import save_inference_model, load_inference_model from paddle.fluid.io import save_inference_model, load_inference_model
class TestBook(unittest.TestCase): class TestBook(unittest.TestCase):
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
import numpy as np import numpy as np
import unittest import unittest
import paddle.v2.fluid.framework as framework import paddle.fluid.framework as framework
import paddle.v2.fluid.initializer as initializer import paddle.fluid.initializer as initializer
DELTA = 0.00001 DELTA = 0.00001
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
import unittest import unittest
import numpy as np import numpy as np
from paddle.v2.fluid.op import Operator from paddle.fluid.op import Operator
import paddle.v2.fluid.core as core import paddle.fluid.core as core
def create_tensor(scope, name, np_data): def create_tensor(scope, name, np_data):
......
...@@ -16,9 +16,9 @@ import numpy as np ...@@ -16,9 +16,9 @@ import numpy as np
from operator import mul from operator import mul
from op_test import OpTest from op_test import OpTest
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from paddle.v2.fluid.op import Operator from paddle.fluid.op import Operator
from paddle.v2.fluid.framework import grad_var_name from paddle.fluid.framework import grad_var_name
np.random.random(123) np.random.random(123)
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
import paddle.v2.fluid.nets as nets import paddle.fluid.nets as nets
from paddle.v2.fluid.framework import Program, program_guard, default_main_program from paddle.fluid.framework import Program, program_guard, default_main_program
from paddle.v2.fluid.param_attr import ParamAttr from paddle.fluid.param_attr import ParamAttr
import decorators import decorators
......
...@@ -17,10 +17,10 @@ import unittest ...@@ -17,10 +17,10 @@ import unittest
import math import math
import copy import copy
import paddle.v2.fluid.framework as framework import paddle.fluid.framework as framework
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
import paddle.v2.fluid.learning_rate_decay as lr_decay import paddle.fluid.learning_rate_decay as lr_decay
def exponential_decay(learning_rate, def exponential_decay(learning_rate,
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import numpy import numpy
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
# 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 paddle.v2.fluid.layers import lod_rank_table, data from paddle.fluid.layers import lod_rank_table, data
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import numpy import numpy
import unittest import unittest
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import numpy import numpy
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import numpy import numpy
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
from paddle.v2.fluid.framework import Program, program_guard from paddle.fluid.framework import Program, program_guard
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
from paddle.v2.fluid.backward import append_backward from paddle.fluid.backward import append_backward
class TestCPULoDTensorArrayOps(unittest.TestCase): class TestCPULoDTensorArrayOps(unittest.TestCase):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import decorators import decorators
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import numpy import numpy
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
import paddle.v2.fluid.optimizer as optimizer import paddle.fluid.optimizer as optimizer
from paddle.v2.fluid.framework import Program, program_guard from paddle.fluid.framework import Program, program_guard
from paddle.v2.fluid.memory_optimization_transpiler import memory_optimize from paddle.fluid.memory_optimization_transpiler import memory_optimize
class TestControlFlowGraph(unittest.TestCase): class TestControlFlowGraph(unittest.TestCase):
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import numpy as np import numpy as np
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
# 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.
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from paddle.v2.fluid.op import Operator from paddle.fluid.op import Operator
import unittest import unittest
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import numpy as np import numpy as np
......
...@@ -16,10 +16,10 @@ import unittest ...@@ -16,10 +16,10 @@ import unittest
import numpy as np import numpy as np
import math import math
from op_test import OpTest from op_test import OpTest
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.core as core import paddle.fluid.core as core
import paddle.v2.fluid.framework as framework import paddle.fluid.framework as framework
from paddle.v2.fluid.framework import Program, program_guard from paddle.fluid.framework import Program, program_guard
class TestOneHotOp(OpTest): class TestOneHotOp(OpTest):
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle.v2.fluid.core as core import paddle.fluid.core as core
class TestOpSupportGPU(unittest.TestCase): class TestOpSupportGPU(unittest.TestCase):
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
import unittest import unittest
import paddle.v2.fluid.op as op import paddle.fluid.op as op
import paddle.v2.fluid.proto.framework_pb2 as framework_pb2 import paddle.fluid.proto.framework_pb2 as framework_pb2
class TestGetAllProtos(unittest.TestCase): class TestGetAllProtos(unittest.TestCase):
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
import unittest import unittest
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from paddle.v2.fluid.framework import Program, default_startup_program from paddle.fluid.framework import Program, default_startup_program
main_program = default_startup_program() main_program = default_startup_program()
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
import unittest import unittest
import paddle.v2.fluid.framework as framework import paddle.fluid.framework as framework
import paddle.v2.fluid.optimizer as optimizer import paddle.fluid.optimizer as optimizer
from paddle.v2.fluid.backward import append_backward from paddle.fluid.backward import append_backward
class TestOptimizer(unittest.TestCase): class TestOptimizer(unittest.TestCase):
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import unittest import unittest
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import numpy import numpy
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
from paddle.v2.fluid.framework import default_main_program from paddle.fluid.framework import default_main_program
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
import paddle.v2.fluid.io as io import paddle.fluid.io as io
from paddle.v2.fluid.initializer import ConstantInitializer from paddle.fluid.initializer import ConstantInitializer
import numpy as np import numpy as np
main_program = default_main_program() main_program = default_main_program()
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from op_test import OpTest from op_test import OpTest
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import unittest import unittest
import numpy as np import numpy as np
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from op_test import OpTest from op_test import OpTest
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle.v2.fluid.core as core import paddle.fluid.core as core
from paddle.v2.fluid.executor import Executor from paddle.fluid.executor import Executor
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
from paddle.v2.fluid.backward import append_backward from paddle.fluid.backward import append_backward
from paddle.v2.fluid.framework import switch_main_program from paddle.fluid.framework import switch_main_program
from paddle.v2.fluid.framework import Program from paddle.fluid.framework import Program
import numpy as np import numpy as np
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
import unittest import unittest
import os import os
import numpy as np import numpy as np
import paddle.v2.fluid as fluid import paddle.fluid as fluid
import paddle.v2.fluid.profiler as profiler import paddle.fluid.profiler as profiler
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
import paddle.v2.fluid.core as core import paddle.fluid.core as core
class TestProfiler(unittest.TestCase): class TestProfiler(unittest.TestCase):
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
from paddle.v2.fluid.framework import Program, default_main_program, program_guard, grad_var_name from paddle.fluid.framework import Program, default_main_program, program_guard, grad_var_name
import paddle.v2.fluid.layers as layers import paddle.fluid.layers as layers
main_program = default_main_program() main_program = default_main_program()
......
...@@ -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.
import paddle.v2.fluid.proto.framework_pb2 as framework_pb2 import paddle.fluid.proto.framework_pb2 as framework_pb2
import unittest import unittest
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import unittest import unittest
import paddle.v2.fluid.core as core import paddle.fluid.core as core
class TestOpDesc(unittest.TestCase): class TestOpDesc(unittest.TestCase):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册