提交 89cfb39f 编写于 作者: Q qiaolongfei

use data_type of data layer

上级 772b476b
......@@ -99,7 +99,7 @@ def main():
# DataProvider Converter is a utility convert Python Object to Paddle C++
# Input. The input format is as same as Paddle's DataProvider.
converter = DataProviderConverter(
input_types=[dp.dense_vector(784), dp.integer_value(10)])
input_types=[images.data_type, label.data_type])
train_file = './data/raw_data/train'
test_file = './data/raw_data/t10k'
......
......@@ -51,8 +51,8 @@ def main():
batch_size=32, # batch size should be refactor in Data reader
data_types={ # data_types will be removed, It should be in
# network topology
'pixel': dense_vector(784),
'label': integer_value(10)
'pixel': images.data_type,
'label': label.data_type
})
......
......@@ -168,15 +168,15 @@ class DataLayerV2(Layer):
def __init__(self, name, data_type, **kwargs):
assert isinstance(data_type, dp.InputType)
self.data_type = data_type
self.__method_name__ = 'data_layer'
self.__kwargs__ = kwargs
self.__data_size__ = data_type.dim
super(DataLayerV2, self).__init__(name=name, parent_layers=dict())
def to_proto_impl(self, **kwargs):
args = dict()
args['size'] = self.__data_size__
args['size'] = self.data_type.dim
for each in kwargs:
args[each] = kwargs[each]
for each in self.__kwargs__:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册