diff --git a/demo/mnist/api_train.py b/demo/mnist/api_train.py index 25c25c1fcddd26b10db7501dae9c5c865f818dd6..ea1caa7dd9653a2cc2860ace736fe3d25a3767e0 100644 --- a/demo/mnist/api_train.py +++ b/demo/mnist/api_train.py @@ -71,9 +71,9 @@ def main(): # define network images = paddle_v2.layer.data( - name='pixel', type=paddle_v2.data.dense_vector(784)) + name='pixel', type=paddle_v2.data_type.dense_vector(784)) label = paddle_v2.layer.data( - name='label', type=paddle_v2.data.integer_value(10)) + name='label', type=paddle_v2.data_type.integer_value(10)) hidden1 = paddle_v2.layer.fc(input=images, size=200) hidden2 = paddle_v2.layer.fc(input=hidden1, size=200) inference = paddle_v2.layer.fc(input=hidden2, diff --git a/demo/mnist/api_train_v2.py b/demo/mnist/api_train_v2.py index c50a46c4d82447e3d48818b8170a55b94d09c467..6fc01ce58be57c77144c6558d039430b22d3a746 100644 --- a/demo/mnist/api_train_v2.py +++ b/demo/mnist/api_train_v2.py @@ -15,8 +15,10 @@ def main(): paddle.init(use_gpu=False, trainer_count=1) # define network topology - images = paddle.layer.data(name='pixel', type=paddle.data.dense_vector(784)) - label = paddle.layer.data(name='label', type=paddle.data.integer_value(10)) + images = paddle.layer.data( + name='pixel', type=paddle.data_type.dense_vector(784)) + label = paddle.layer.data( + name='label', type=paddle.data_type.integer_value(10)) hidden1 = paddle.layer.fc(input=images, size=200) hidden2 = paddle.layer.fc(input=hidden1, size=200) inference = paddle.layer.fc(input=hidden2, diff --git a/python/paddle/v2/__init__.py b/python/paddle/v2/__init__.py index cd6dfce0e66765120e3ddba00fe288aae4b43f43..c0a2bdc4259c3f48e8e7fdf4c8d8b2584253875a 100644 --- a/python/paddle/v2/__init__.py +++ b/python/paddle/v2/__init__.py @@ -17,12 +17,12 @@ import activation import parameters import trainer import event -import data +import data_type import py_paddle.swig_paddle as api __all__ = [ 'optimizer', 'layer', 'activation', 'parameters', 'init', 'trainer', - 'event', 'data' + 'event', 'data_type.py' ] diff --git a/python/paddle/v2/data.py b/python/paddle/v2/data_type.py similarity index 100% rename from python/paddle/v2/data.py rename to python/paddle/v2/data_type.py diff --git a/python/paddle/v2/layer.py b/python/paddle/v2/layer.py index f5a411198e47ab46bd720852a14cfa58955eddce..4d052c983c2c07730fe5111ccb961de68e73fb8f 100644 --- a/python/paddle/v2/layer.py +++ b/python/paddle/v2/layer.py @@ -67,7 +67,7 @@ paddle.v2.parameters.create, no longer exposed to users. """ import paddle.trainer_config_helpers as conf_helps -from . import data as v2_data +from . import data_type as v2_data from paddle.trainer_config_helpers.config_parser_utils import \ parse_network_config as __parse__ from paddle.trainer_config_helpers.default_decorators import wrap_name_default