未验证 提交 4adc8a7a 编写于 作者: Q Qiao Longfei 提交者: GitHub

Change framework to fluid (#5637)

* init commit

* change some dir name
上级 f06d8f0d
...@@ -21,7 +21,7 @@ third_party/ ...@@ -21,7 +21,7 @@ third_party/
cmake-build-* cmake-build-*
# generated while compiling # generated while compiling
python/paddle/v2/framework/core.so python/paddle/v2/fluid/core.so
paddle/pybind/pybind.h paddle/pybind/pybind.h
CMakeFiles CMakeFiles
cmake_install.cmake cmake_install.cmake
......
...@@ -37,10 +37,10 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in ...@@ -37,10 +37,10 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in
${CMAKE_CURRENT_BINARY_DIR}/setup.py) ${CMAKE_CURRENT_BINARY_DIR}/setup.py)
add_custom_command(OUTPUT ${PADDLE_SOURCE_DIR}/python/paddle/v2/framework/core.so add_custom_command(OUTPUT ${PADDLE_SOURCE_DIR}/python/paddle/v2/fluid/core.so
COMMAND cmake -E copy $<TARGET_FILE:paddle_pybind> ${PADDLE_SOURCE_DIR}/python/paddle/v2/framework/core.so COMMAND cmake -E copy $<TARGET_FILE:paddle_pybind> ${PADDLE_SOURCE_DIR}/python/paddle/v2/fluid/core.so
DEPENDS paddle_pybind) DEPENDS paddle_pybind)
add_custom_target(copy_paddle_pybind ALL DEPENDS ${PADDLE_SOURCE_DIR}/python/paddle/v2/framework/core.so) add_custom_target(copy_paddle_pybind ALL DEPENDS ${PADDLE_SOURCE_DIR}/python/paddle/v2/fluid/core.so)
add_custom_command(OUTPUT ${PADDLE_PYTHON_BUILD_DIR}/.timestamp add_custom_command(OUTPUT ${PADDLE_PYTHON_BUILD_DIR}/.timestamp
...@@ -66,7 +66,7 @@ if (WITH_TESTING) ...@@ -66,7 +66,7 @@ if (WITH_TESTING)
add_subdirectory(paddle/v2/tests) add_subdirectory(paddle/v2/tests)
add_subdirectory(paddle/v2/reader/tests) add_subdirectory(paddle/v2/reader/tests)
add_subdirectory(paddle/v2/plot/tests) add_subdirectory(paddle/v2/plot/tests)
add_subdirectory(paddle/v2/framework/tests) add_subdirectory(paddle/v2/fluid/tests)
endif() endif()
endif() endif()
install(DIRECTORY ${PADDLE_PYTHON_PACKAGE_DIR} install(DIRECTORY ${PADDLE_PYTHON_PACKAGE_DIR}
......
from paddle.v2.framework import framework as framework from paddle.v2.fluid import framework as framework
__all__ = ['append_backward_ops'] __all__ = ['append_backward_ops']
......
...@@ -13,7 +13,7 @@ A `scoped_function` will take a `function` as input. That function will be ...@@ -13,7 +13,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.framework.core import paddle.v2.fluid.core
import threading import threading
__tl_scope__ = threading.local() __tl_scope__ = threading.local()
...@@ -27,13 +27,13 @@ __all__ = [ ...@@ -27,13 +27,13 @@ __all__ = [
def get_cur_scope(): def get_cur_scope():
""" """
Get current scope. Get current scope.
:rtype: paddle.v2.framework.core.Scope :rtype: paddle.v2.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.framework.core.Scope()) __tl_scope__.cur_scope.append(paddle.v2.fluid.core.Scope())
return __tl_scope__.cur_scope[-1] return __tl_scope__.cur_scope[-1]
......
import paddle.v2.framework.op as op import paddle.v2.fluid.op as op
import numpy as np import numpy as np
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
def avg_accumulate(accumulated_var, per_eval, num_batches, place): def avg_accumulate(accumulated_var, per_eval, num_batches, place):
...@@ -22,7 +22,7 @@ class Evaluator(object): ...@@ -22,7 +22,7 @@ class Evaluator(object):
NOTE: default run on CPUPlace(), running on GPUPlace doesn't improve performance much. NOTE: default run on CPUPlace(), running on GPUPlace doesn't improve performance much.
:param scope: the scope instance contains the input. :param scope: the scope instance contains the input.
:type scope: paddle.v2.framework.core.scope :type scope: paddle.v2.fluid.core.scope
:param operator: operator name for caculating the evaluation for each mini-batch. :param operator: operator name for caculating the evaluation for each mini-batch.
:type operator: string :type operator: string
:param input: output variable name of forward network. :param input: output variable name of forward network.
......
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
from paddle.v2.framework.framework import Block, Program, g_main_program from paddle.v2.fluid.framework import Block, Program, g_main_program
g_scope = core.Scope() g_scope = core.Scope()
......
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import paddle.v2.framework.proto.framework_pb2 as framework_pb2 import paddle.v2.fluid.proto.framework_pb2 as framework_pb2
import collections import collections
import numpy as np import numpy as np
import copy import copy
......
import paddle.v2.framework.framework as framework import paddle.v2.fluid.framework as framework
import numpy as np import numpy as np
__all__ = [ __all__ = [
......
import os import os
import cPickle as pickle import cPickle as pickle
from paddle.v2.framework.framework import Program, Parameter, g_main_program, \ from paddle.v2.fluid.framework import Program, Parameter, g_main_program, \
Variable Variable
__all__ = [ __all__ = [
......
import copy import copy
import itertools import itertools
from paddle.v2.framework.framework import Variable, g_main_program, \ from paddle.v2.fluid.framework import Variable, g_main_program, \
g_startup_program, unique_name, Program g_startup_program, unique_name, Program
from paddle.v2.framework.initializer import ConstantInitializer, \ from paddle.v2.fluid.initializer import ConstantInitializer, \
UniformInitializer, XavierInitializer UniformInitializer, XavierInitializer
......
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import paddle.v2.framework.proto.framework_pb2 as framework_pb2 import paddle.v2.fluid.proto.framework_pb2 as framework_pb2
from paddle.v2.framework.framework import OpProtoHolder, Variable, Program, \ from paddle.v2.fluid.framework import OpProtoHolder, Variable, Program, \
Operator Operator
from paddle.v2.framework.initializer import ConstantInitializer, \ from paddle.v2.fluid.initializer import ConstantInitializer, \
NormalInitializer NormalInitializer
from paddle.v2.framework.layer_helper import LayerHelper, unique_name from paddle.v2.fluid.layer_helper import LayerHelper, unique_name
import re import re
import cStringIO import cStringIO
......
...@@ -3,8 +3,8 @@ import json ...@@ -3,8 +3,8 @@ import json
import logging import logging
from collections import defaultdict from collections import defaultdict
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import paddle.v2.framework.proto.framework_pb2 as framework_pb2 import paddle.v2.fluid.proto.framework_pb2 as framework_pb2
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)
......
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
__all__ = ["simple_img_conv_pool", "sequence_conv_pool"] __all__ = ["simple_img_conv_pool", "sequence_conv_pool"]
......
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import paddle.v2.framework.proto.framework_pb2 as framework_pb2 import paddle.v2.fluid.proto.framework_pb2 as framework_pb2
def get_all_op_protos(): def get_all_op_protos():
......
from collections import defaultdict from collections import defaultdict
import paddle.v2.framework.framework as framework import paddle.v2.fluid.framework as framework
from paddle.v2.framework.framework import unique_name, Program from paddle.v2.fluid.framework import unique_name, Program
from paddle.v2.framework.backward import append_backward_ops from paddle.v2.fluid.backward import append_backward_ops
from paddle.v2.framework.initializer import ConstantInitializer from paddle.v2.fluid.initializer import ConstantInitializer
from paddle.v2.framework.regularizer import append_regularization_ops from paddle.v2.fluid.regularizer import append_regularization_ops
from paddle.v2.framework.layer_helper import LayerHelper from paddle.v2.fluid.layer_helper import LayerHelper
__all__ = [ __all__ = [
'SGDOptimizer', 'MomentumOptimizer', 'AdagradOptimizer', 'AdamOptimizer', 'SGDOptimizer', 'MomentumOptimizer', 'AdagradOptimizer', 'AdamOptimizer',
......
import paddle.v2.framework.framework as framework import paddle.v2.fluid.framework as framework
__all__ = [ __all__ = [
'append_regularization_ops', 'L2DecayRegularizer', 'L1DecayRegularizer' 'append_regularization_ops', 'L2DecayRegularizer', 'L1DecayRegularizer'
......
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import paddle.v2.framework.optimizer as optimizer import paddle.v2.fluid.optimizer as optimizer
from paddle.v2.framework.framework import Program from paddle.v2.fluid.framework import Program
from paddle.v2.framework.io import save_persistables, load_persistables from paddle.v2.fluid.io import save_persistables, load_persistables
from paddle.v2.framework.executor import Executor from paddle.v2.fluid.executor import Executor
import numpy as np import numpy as np
......
import numpy as np import numpy as np
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
import paddle.v2.framework.nets as nets import paddle.v2.fluid.nets as nets
import paddle.v2.framework.optimizer as optimizer import paddle.v2.fluid.optimizer as optimizer
from paddle.v2.framework.executor import Executor from paddle.v2.fluid.executor import Executor
from paddle.v2.framework.framework import g_startup_program, g_main_program from paddle.v2.fluid.framework import g_startup_program, g_main_program
from paddle.v2.framework.initializer import XavierInitializer from paddle.v2.fluid.initializer import XavierInitializer
def resnet_cifar10(input, depth=32, main_program=None, startup_program=None): def resnet_cifar10(input, depth=32, main_program=None, startup_program=None):
......
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
import paddle.v2.framework.nets as nets import paddle.v2.fluid.nets as nets
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import paddle.v2.framework.optimizer as optimizer import paddle.v2.fluid.optimizer as optimizer
from paddle.v2.framework.framework import Program from paddle.v2.fluid.framework import Program
from paddle.v2.framework.executor import Executor from paddle.v2.fluid.executor import Executor
import numpy as np import numpy as np
......
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import paddle.v2.framework.optimizer as optimizer import paddle.v2.fluid.optimizer as optimizer
from paddle.v2.framework.framework import Program from paddle.v2.fluid.framework import Program
from paddle.v2.framework.executor import Executor from paddle.v2.fluid.executor import Executor
from paddle.v2.framework.regularizer import L2DecayRegularizer from paddle.v2.fluid.regularizer import L2DecayRegularizer
from paddle.v2.framework.initializer import UniformInitializer from paddle.v2.fluid.initializer import UniformInitializer
import numpy as np import numpy as np
......
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
import paddle.v2.framework.nets as nets import paddle.v2.fluid.nets as nets
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import paddle.v2.framework.optimizer as optimizer import paddle.v2.fluid.optimizer as optimizer
from paddle.v2.framework.framework import Program from paddle.v2.fluid.framework import Program
from paddle.v2.framework.executor import Executor from paddle.v2.fluid.executor import Executor
import numpy as np import numpy as np
......
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
import paddle.v2.framework.nets as nets import paddle.v2.fluid.nets as nets
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import paddle.v2.framework.optimizer as optimizer import paddle.v2.fluid.optimizer as optimizer
from paddle.v2.framework.framework import Program, g_main_program, g_startup_program from paddle.v2.fluid.framework import Program, g_main_program, g_startup_program
from paddle.v2.framework.executor import Executor from paddle.v2.fluid.executor import Executor
import numpy as np import numpy as np
......
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
import paddle.v2.framework.nets as nets import paddle.v2.fluid.nets as nets
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import paddle.v2.framework.optimizer as optimizer import paddle.v2.fluid.optimizer as optimizer
from paddle.v2.framework.framework import Program, g_main_program, g_startup_program from paddle.v2.fluid.framework import Program, g_main_program, g_startup_program
from paddle.v2.framework.executor import Executor from paddle.v2.fluid.executor import Executor
import numpy as np import numpy as np
......
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import paddle.v2.framework.optimizer as optimizer import paddle.v2.fluid.optimizer as optimizer
from paddle.v2.framework.framework import g_main_program, g_startup_program from paddle.v2.fluid.framework import g_main_program, g_startup_program
from paddle.v2.framework.executor import Executor from paddle.v2.fluid.executor import Executor
import numpy as np import numpy as np
......
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import paddle.v2.framework.optimizer as optimizer import paddle.v2.fluid.optimizer as optimizer
from paddle.v2.framework.framework import Program from paddle.v2.fluid.framework import Program
from paddle.v2.framework.executor import Executor from paddle.v2.fluid.executor import Executor
import numpy as np import numpy as np
......
...@@ -2,12 +2,12 @@ import unittest ...@@ -2,12 +2,12 @@ import unittest
import numpy as np import numpy as np
import random import random
import itertools import itertools
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import collections import collections
from paddle.v2.framework.backward import append_backward_ops from paddle.v2.fluid.backward import append_backward_ops
from paddle.v2.framework.op import Operator from paddle.v2.fluid.op import Operator
from paddle.v2.framework.executor import Executor from paddle.v2.fluid.executor import Executor
from paddle.v2.framework.framework import Program, OpProtoHolder from paddle.v2.fluid.framework import Program, OpProtoHolder
def randomize_probability(batch_size, class_num, dtype='float32'): def randomize_probability(batch_size, class_num, dtype='float32'):
......
import unittest import unittest
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
from paddle.v2.framework.executor import Executor from paddle.v2.fluid.executor import Executor
from paddle.v2.framework.backward import append_backward_ops from paddle.v2.fluid.backward import append_backward_ops
from paddle.v2.framework.framework import g_main_program from paddle.v2.fluid.framework import g_main_program
import numpy import numpy
......
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.framework.core as core import paddle.v2.fluid.core as core
from paddle.v2.framework.op import Operator from paddle.v2.fluid.op import Operator
def grad_var_name(var_name): def grad_var_name(var_name):
......
import op_test import op_test
import unittest import unittest
import numpy as np import numpy as np
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
class TestCastOp(op_test.OpTest): class TestCastOp(op_test.OpTest):
......
import logging import logging
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import unittest import unittest
import numpy as np import numpy as np
from paddle.v2.framework.op import Operator, CondOp from paddle.v2.fluid.op import Operator, CondOp
class PySimpleCond(object): class PySimpleCond(object):
......
import unittest import unittest
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
from paddle.v2.framework.framework import g_startup_program, g_main_program from paddle.v2.fluid.framework import g_startup_program, g_main_program
from paddle.v2.framework.executor import Executor from paddle.v2.fluid.executor import Executor
from paddle.v2.framework.backward import append_backward_ops from paddle.v2.fluid.backward import append_backward_ops
import numpy import numpy
......
import unittest import unittest
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
class TestDocString(unittest.TestCase): class TestDocString(unittest.TestCase):
......
from paddle.v2.framework.default_scope_funcs import * from paddle.v2.fluid.default_scope_funcs import *
import unittest import unittest
......
import logging import logging
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import unittest import unittest
from paddle.v2.framework.op import Operator, DynamicRecurrentOp from paddle.v2.fluid.op import Operator, DynamicRecurrentOp
import numpy as np import numpy as np
# for siplicity, just one level LoD # for siplicity, just one level LoD
......
from paddle.v2.framework.evaluator import Evaluator from paddle.v2.fluid.evaluator import Evaluator
from paddle.v2.framework.op import Operator from paddle.v2.fluid.op import Operator
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import unittest import unittest
import op_test import op_test
import numpy as np import numpy as np
......
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import unittest import unittest
......
import unittest import unittest
from paddle.v2.framework.layers import mul, data from paddle.v2.fluid.layers import mul, data
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
from paddle.v2.framework.executor import Executor from paddle.v2.fluid.executor import Executor
from paddle.v2.framework.framework import g_main_program from paddle.v2.fluid.framework import g_main_program
import numpy import numpy
......
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import unittest import unittest
import numpy as np import numpy as np
......
import unittest import unittest
from paddle.v2.framework.framework import Program from paddle.v2.fluid.framework import Program
class TestDebugStringFramework(unittest.TestCase): class TestDebugStringFramework(unittest.TestCase):
......
import unittest import unittest
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
from paddle.v2.framework.op import Operator from paddle.v2.fluid.op import Operator
import numpy import numpy
......
import unittest import unittest
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
import paddle.v2.framework.nets as nets import paddle.v2.fluid.nets as nets
from paddle.v2.framework.framework import Program from paddle.v2.fluid.framework import Program
def conv_block(input, def conv_block(input,
......
import unittest import unittest
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
class TestInferShape(unittest.TestCase): class TestInferShape(unittest.TestCase):
......
import paddle.v2 as paddle import paddle.v2 as paddle
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import paddle.v2.framework.optimizer as optimizer import paddle.v2.fluid.optimizer as optimizer
from paddle.v2.framework.framework import Program from paddle.v2.fluid.framework import Program
from paddle.v2.framework.io import save_inference_model, load_inference_model from paddle.v2.fluid.io import save_inference_model, load_inference_model
import paddle.v2.framework.executor as executor import paddle.v2.fluid.executor as executor
import unittest import unittest
import numpy as np import numpy as np
......
import numpy as np import numpy as np
import unittest import unittest
import paddle.v2.framework.framework as framework import paddle.v2.fluid.framework as framework
import paddle.v2.framework.initializer as initializer import paddle.v2.fluid.initializer as initializer
DELTA = 0.00001 DELTA = 0.00001
......
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
import paddle.v2.framework.nets as nets import paddle.v2.fluid.nets as nets
from paddle.v2.framework.framework import Program from paddle.v2.fluid.framework import Program
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import unittest import unittest
......
import unittest import unittest
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
from paddle.v2.framework.executor import Executor from paddle.v2.fluid.executor import Executor
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import numpy import numpy
......
from paddle.v2.framework.layers import lod_rank_table, data from paddle.v2.fluid.layers import lod_rank_table, data
from paddle.v2.framework.executor import Executor from paddle.v2.fluid.executor import Executor
from paddle.v2.framework.framework import g_main_program from paddle.v2.fluid.framework import g_main_program
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import numpy import numpy
import unittest import unittest
......
import unittest import unittest
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import numpy import numpy
......
import unittest import unittest
import paddle.v2.framework.core as core import paddle.v2.fluid.core as core
import numpy import numpy
import paddle.v2.framework.layers as layers import paddle.v2.fluid.layers as layers
from paddle.v2.framework.framework import Program from paddle.v2.fluid.framework import Program
from paddle.v2.framework.executor import Executor from paddle.v2.fluid.executor import Executor
from paddle.v2.framework.backward import append_backward_ops from paddle.v2.fluid.backward import append_backward_ops
class TestCPULoDTensorArrayOps(unittest.TestCase): class TestCPULoDTensorArrayOps(unittest.TestCase):
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册