Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change framework to fluid #5637

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ third_party/
cmake-build-*

# generated while compiling
python/paddle/v2/framework/core.so
python/paddle/v2/fluid/core.so
paddle/pybind/pybind.h
CMakeFiles
cmake_install.cmake
Expand Down
8 changes: 4 additions & 4 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in
${CMAKE_CURRENT_BINARY_DIR}/setup.py)


add_custom_command(OUTPUT ${PADDLE_SOURCE_DIR}/python/paddle/v2/framework/core.so
COMMAND cmake -E copy $<TARGET_FILE:paddle_pybind> ${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/fluid/core.so
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
Expand All @@ -66,7 +66,7 @@ if (WITH_TESTING)
add_subdirectory(paddle/v2/tests)
add_subdirectory(paddle/v2/reader/tests)
add_subdirectory(paddle/v2/plot/tests)
add_subdirectory(paddle/v2/framework/tests)
add_subdirectory(paddle/v2/fluid/tests)
endif()
endif()
install(DIRECTORY ${PADDLE_PYTHON_PACKAGE_DIR}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from paddle.v2.framework import framework as framework
from paddle.v2.fluid import framework as framework

__all__ = ['append_backward_ops']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
invoked in a new local scope.
"""

import paddle.v2.framework.core
import paddle.v2.fluid.core
import threading

__tl_scope__ = threading.local()
Expand All @@ -27,13 +27,13 @@
def get_cur_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)
if cur_scope_stack is None:
__tl_scope__.cur_scope = list()
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]


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import paddle.v2.framework.op as op
import paddle.v2.fluid.op as op
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):
Expand All @@ -22,7 +22,7 @@ def __init__(self,
NOTE: default run on CPUPlace(), running on GPUPlace doesn't improve performance much.

: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.
:type operator: string
:param input: output variable name of forward network.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import paddle.v2.framework.core as core
from paddle.v2.framework.framework import Block, Program, g_main_program
import paddle.v2.fluid.core as core
from paddle.v2.fluid.framework import Block, Program, g_main_program

g_scope = core.Scope()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import paddle.v2.framework.core as core
import paddle.v2.framework.proto.framework_pb2 as framework_pb2
import paddle.v2.fluid.core as core
import paddle.v2.fluid.proto.framework_pb2 as framework_pb2
import collections
import numpy as np
import copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import paddle.v2.framework.framework as framework
import paddle.v2.fluid.framework as framework
import numpy as np

__all__ = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
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

__all__ = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import copy
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
from paddle.v2.framework.initializer import ConstantInitializer, \
from paddle.v2.fluid.initializer import ConstantInitializer, \
UniformInitializer, XavierInitializer


Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import paddle.v2.framework.core as core
import paddle.v2.framework.proto.framework_pb2 as framework_pb2
from paddle.v2.framework.framework import OpProtoHolder, Variable, Program, \
import paddle.v2.fluid.core as core
import paddle.v2.fluid.proto.framework_pb2 as framework_pb2
from paddle.v2.fluid.framework import OpProtoHolder, Variable, Program, \
Operator
from paddle.v2.framework.initializer import ConstantInitializer, \
from paddle.v2.fluid.initializer import ConstantInitializer, \
NormalInitializer
from paddle.v2.framework.layer_helper import LayerHelper, unique_name
from paddle.v2.fluid.layer_helper import LayerHelper, unique_name
import re
import cStringIO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import logging
from collections import defaultdict

import paddle.v2.framework.core as core
import paddle.v2.framework.proto.framework_pb2 as framework_pb2
import paddle.v2.fluid.core as core
import paddle.v2.fluid.proto.framework_pb2 as framework_pb2

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import paddle.v2.framework.layers as layers
import paddle.v2.fluid.layers as layers

__all__ = ["simple_img_conv_pool", "sequence_conv_pool"]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import paddle.v2.framework.core as core
import paddle.v2.framework.proto.framework_pb2 as framework_pb2
import paddle.v2.fluid.core as core
import paddle.v2.fluid.proto.framework_pb2 as framework_pb2


def get_all_op_protos():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from collections import defaultdict

import paddle.v2.framework.framework as framework
from paddle.v2.framework.framework import unique_name, Program
from paddle.v2.framework.backward import append_backward_ops
from paddle.v2.framework.initializer import ConstantInitializer
from paddle.v2.framework.regularizer import append_regularization_ops
from paddle.v2.framework.layer_helper import LayerHelper
import paddle.v2.fluid.framework as framework
from paddle.v2.fluid.framework import unique_name, Program
from paddle.v2.fluid.backward import append_backward_ops
from paddle.v2.fluid.initializer import ConstantInitializer
from paddle.v2.fluid.regularizer import append_regularization_ops
from paddle.v2.fluid.layer_helper import LayerHelper

__all__ = [
'SGDOptimizer', 'MomentumOptimizer', 'AdagradOptimizer', 'AdamOptimizer',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import paddle.v2.framework.framework as framework
import paddle.v2.fluid.framework as framework

__all__ = [
'append_regularization_ops', 'L2DecayRegularizer', 'L1DecayRegularizer'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import paddle.v2 as paddle
import paddle.v2.framework.layers as layers
import paddle.v2.framework.core as core
import paddle.v2.framework.optimizer as optimizer
import paddle.v2.fluid.layers as layers
import paddle.v2.fluid.core as core
import paddle.v2.fluid.optimizer as optimizer

from paddle.v2.framework.framework import Program
from paddle.v2.framework.io import save_persistables, load_persistables
from paddle.v2.framework.executor import Executor
from paddle.v2.fluid.framework import Program
from paddle.v2.fluid.io import save_persistables, load_persistables
from paddle.v2.fluid.executor import Executor

import numpy as np

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import numpy as np
import paddle.v2 as paddle
import paddle.v2.framework.core as core
import paddle.v2.framework.layers as layers
import paddle.v2.framework.nets as nets
import paddle.v2.framework.optimizer as optimizer
from paddle.v2.framework.executor import Executor
from paddle.v2.framework.framework import g_startup_program, g_main_program
from paddle.v2.framework.initializer import XavierInitializer
import paddle.v2.fluid.core as core
import paddle.v2.fluid.layers as layers
import paddle.v2.fluid.nets as nets
import paddle.v2.fluid.optimizer as optimizer
from paddle.v2.fluid.executor import Executor
from paddle.v2.fluid.framework import g_startup_program, g_main_program
from paddle.v2.fluid.initializer import XavierInitializer


def resnet_cifar10(input, depth=32, main_program=None, startup_program=None):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import paddle.v2 as paddle
import paddle.v2.framework.layers as layers
import paddle.v2.framework.nets as nets
import paddle.v2.framework.core as core
import paddle.v2.framework.optimizer as optimizer
import paddle.v2.fluid.layers as layers
import paddle.v2.fluid.nets as nets
import paddle.v2.fluid.core as core
import paddle.v2.fluid.optimizer as optimizer

from paddle.v2.framework.framework import Program
from paddle.v2.framework.executor import Executor
from paddle.v2.fluid.framework import Program
from paddle.v2.fluid.executor import Executor

import numpy as np

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import paddle.v2 as paddle
import paddle.v2.framework.layers as layers
import paddle.v2.framework.core as core
import paddle.v2.framework.optimizer as optimizer

from paddle.v2.framework.framework import Program
from paddle.v2.framework.executor import Executor
from paddle.v2.framework.regularizer import L2DecayRegularizer
from paddle.v2.framework.initializer import UniformInitializer
import paddle.v2.fluid.layers as layers
import paddle.v2.fluid.core as core
import paddle.v2.fluid.optimizer as optimizer

from paddle.v2.fluid.framework import Program
from paddle.v2.fluid.executor import Executor
from paddle.v2.fluid.regularizer import L2DecayRegularizer
from paddle.v2.fluid.initializer import UniformInitializer

import numpy as np

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import paddle.v2 as paddle
import paddle.v2.framework.layers as layers
import paddle.v2.framework.nets as nets
import paddle.v2.framework.core as core
import paddle.v2.framework.optimizer as optimizer
import paddle.v2.fluid.layers as layers
import paddle.v2.fluid.nets as nets
import paddle.v2.fluid.core as core
import paddle.v2.fluid.optimizer as optimizer

from paddle.v2.framework.framework import Program
from paddle.v2.framework.executor import Executor
from paddle.v2.fluid.framework import Program
from paddle.v2.fluid.executor import Executor

import numpy as np

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import paddle.v2 as paddle
import paddle.v2.framework.layers as layers
import paddle.v2.framework.nets as nets
import paddle.v2.framework.core as core
import paddle.v2.framework.optimizer as optimizer
import paddle.v2.fluid.layers as layers
import paddle.v2.fluid.nets as nets
import paddle.v2.fluid.core as core
import paddle.v2.fluid.optimizer as optimizer

from paddle.v2.framework.framework import Program, g_main_program, g_startup_program
from paddle.v2.framework.executor import Executor
from paddle.v2.fluid.framework import Program, g_main_program, g_startup_program
from paddle.v2.fluid.executor import Executor

import numpy as np

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import paddle.v2 as paddle
import paddle.v2.framework.layers as layers
import paddle.v2.framework.nets as nets
import paddle.v2.framework.core as core
import paddle.v2.framework.optimizer as optimizer
import paddle.v2.fluid.layers as layers
import paddle.v2.fluid.nets as nets
import paddle.v2.fluid.core as core
import paddle.v2.fluid.optimizer as optimizer

from paddle.v2.framework.framework import Program, g_main_program, g_startup_program
from paddle.v2.framework.executor import Executor
from paddle.v2.fluid.framework import Program, g_main_program, g_startup_program
from paddle.v2.fluid.executor import Executor

import numpy as np

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import paddle.v2 as paddle
import paddle.v2.framework.layers as layers
import paddle.v2.framework.core as core
import paddle.v2.framework.optimizer as optimizer
import paddle.v2.fluid.layers as layers
import paddle.v2.fluid.core as core
import paddle.v2.fluid.optimizer as optimizer

from paddle.v2.framework.framework import g_main_program, g_startup_program
from paddle.v2.framework.executor import Executor
from paddle.v2.fluid.framework import g_main_program, g_startup_program
from paddle.v2.fluid.executor import Executor

import numpy as np

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import paddle.v2 as paddle
import paddle.v2.framework.layers as layers
import paddle.v2.framework.core as core
import paddle.v2.framework.optimizer as optimizer
import paddle.v2.fluid.layers as layers
import paddle.v2.fluid.core as core
import paddle.v2.fluid.optimizer as optimizer

from paddle.v2.framework.framework import Program
from paddle.v2.framework.executor import Executor
from paddle.v2.fluid.framework import Program
from paddle.v2.fluid.executor import Executor

import numpy as np

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import numpy as np
import random
import itertools
import paddle.v2.framework.core as core
import paddle.v2.fluid.core as core
import collections
from paddle.v2.framework.backward import append_backward_ops
from paddle.v2.framework.op import Operator
from paddle.v2.framework.executor import Executor
from paddle.v2.framework.framework import Program, OpProtoHolder
from paddle.v2.fluid.backward import append_backward_ops
from paddle.v2.fluid.op import Operator
from paddle.v2.fluid.executor import Executor
from paddle.v2.fluid.framework import Program, OpProtoHolder


def randomize_probability(batch_size, class_num, dtype='float32'):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import unittest
import paddle.v2.framework.core as core
import paddle.v2.framework.layers as layers
from paddle.v2.framework.executor import Executor
from paddle.v2.framework.backward import append_backward_ops
from paddle.v2.framework.framework import g_main_program
import paddle.v2.fluid.core as core
import paddle.v2.fluid.layers as layers
from paddle.v2.fluid.executor import Executor
from paddle.v2.fluid.backward import append_backward_ops
from paddle.v2.fluid.framework import g_main_program
import numpy


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import unittest
import numpy as np
from op_test import OpTest
import paddle.v2.framework.core as core
from paddle.v2.framework.op import Operator
import paddle.v2.fluid.core as core
from paddle.v2.fluid.op import Operator


def grad_var_name(var_name):
Expand Down
Loading