Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wzpei9
Paddle
提交
ecc4dc6d
P
Paddle
项目概览
wzpei9
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ecc4dc6d
编写于
9月 17, 2018
作者:
Y
yuyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Hide RecordIO Reader
上级
3fbfcd9c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
11 addition
and
16 deletion
+11
-16
doc/fluid/api/layers.rst
doc/fluid/api/layers.rst
+0
-8
python/paddle/fluid/layers/io.py
python/paddle/fluid/layers/io.py
+2
-3
python/paddle/fluid/tests/unittests/test_multi_pass_reader.py
...on/paddle/fluid/tests/unittests/test_multi_pass_reader.py
+2
-1
python/paddle/fluid/tests/unittests/test_preprocessor.py
python/paddle/fluid/tests/unittests/test_preprocessor.py
+3
-2
python/paddle/fluid/tests/unittests/test_recordio_reader.py
python/paddle/fluid/tests/unittests/test_recordio_reader.py
+2
-1
python/paddle/fluid/tests/unittests/transformer_model.py
python/paddle/fluid/tests/unittests/transformer_model.py
+2
-1
未找到文件。
doc/fluid/api/layers.rst
浏览文件 @
ecc4dc6d
...
@@ -290,14 +290,6 @@ Recv
...
@@ -290,14 +290,6 @@ Recv
.. autofunction:: paddle.fluid.layers.Recv
.. autofunction:: paddle.fluid.layers.Recv
:noindex:
:noindex:
.. _api_fluid_layers_open_recordio_file:
open_recordio_file
------------------
.. autofunction:: paddle.fluid.layers.open_recordio_file
:noindex:
.. _api_fluid_layers_open_files:
.. _api_fluid_layers_open_files:
open_files
open_files
...
...
python/paddle/fluid/layers/io.py
浏览文件 @
ecc4dc6d
...
@@ -29,9 +29,8 @@ from ..layer_helper import LayerHelper
...
@@ -29,9 +29,8 @@ from ..layer_helper import LayerHelper
from
..unique_name
import
generate
as
unique_name
from
..unique_name
import
generate
as
unique_name
__all__
=
[
__all__
=
[
'data'
,
'open_recordio_file'
,
'open_files'
,
'read_file'
,
'shuffle'
,
'batch'
,
'data'
,
'open_files'
,
'read_file'
,
'shuffle'
,
'batch'
,
'double_buffer'
,
'double_buffer'
,
'random_data_generator'
,
'py_reader'
,
'Preprocessor'
,
'random_data_generator'
,
'py_reader'
,
'Preprocessor'
,
'load'
'load'
]
]
...
...
python/paddle/fluid/tests/unittests/test_multi_pass_reader.py
浏览文件 @
ecc4dc6d
...
@@ -19,6 +19,7 @@ import unittest
...
@@ -19,6 +19,7 @@ import unittest
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
paddle
import
paddle
import
paddle.dataset.mnist
as
mnist
import
paddle.dataset.mnist
as
mnist
from
paddle.fluid.layers.io
import
open_recordio_file
class
TestMultipleReader
(
unittest
.
TestCase
):
class
TestMultipleReader
(
unittest
.
TestCase
):
...
@@ -41,7 +42,7 @@ class TestMultipleReader(unittest.TestCase):
...
@@ -41,7 +42,7 @@ class TestMultipleReader(unittest.TestCase):
def
test_main
(
self
):
def
test_main
(
self
):
with
fluid
.
program_guard
(
fluid
.
Program
(),
fluid
.
Program
()):
with
fluid
.
program_guard
(
fluid
.
Program
(),
fluid
.
Program
()):
data_file
=
fluid
.
layers
.
open_recordio_file
(
data_file
=
open_recordio_file
(
filename
=
'./mnist.recordio'
,
filename
=
'./mnist.recordio'
,
shapes
=
[(
-
1
,
784
),
(
-
1
,
1
)],
shapes
=
[(
-
1
,
784
),
(
-
1
,
1
)],
lod_levels
=
[
0
,
0
],
lod_levels
=
[
0
,
0
],
...
...
python/paddle/fluid/tests/unittests/test_preprocessor.py
浏览文件 @
ecc4dc6d
...
@@ -20,6 +20,7 @@ import numpy as np
...
@@ -20,6 +20,7 @@ import numpy as np
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
paddle.dataset.mnist
as
mnist
import
paddle.dataset.mnist
as
mnist
from
paddle.fluid.layers.io
import
open_recordio_file
class
TestPreprocessor
(
unittest
.
TestCase
):
class
TestPreprocessor
(
unittest
.
TestCase
):
...
@@ -43,7 +44,7 @@ class TestPreprocessor(unittest.TestCase):
...
@@ -43,7 +44,7 @@ class TestPreprocessor(unittest.TestCase):
img_expected_res
=
[]
img_expected_res
=
[]
lbl_expected_res
=
[]
lbl_expected_res
=
[]
with
fluid
.
program_guard
(
fluid
.
Program
(),
fluid
.
Program
()):
with
fluid
.
program_guard
(
fluid
.
Program
(),
fluid
.
Program
()):
data_file
=
fluid
.
layers
.
io
.
open_recordio_file
(
data_file
=
open_recordio_file
(
'./mnist_for_preprocessor_test.recordio'
,
'./mnist_for_preprocessor_test.recordio'
,
shapes
=
[[
-
1
,
784
],
[
-
1
,
1
]],
shapes
=
[[
-
1
,
784
],
[
-
1
,
1
]],
lod_levels
=
[
0
,
0
],
lod_levels
=
[
0
,
0
],
...
@@ -64,7 +65,7 @@ class TestPreprocessor(unittest.TestCase):
...
@@ -64,7 +65,7 @@ class TestPreprocessor(unittest.TestCase):
img_actual_res
=
[]
img_actual_res
=
[]
lbl_actual_res
=
[]
lbl_actual_res
=
[]
with
fluid
.
program_guard
(
fluid
.
Program
(),
fluid
.
Program
()):
with
fluid
.
program_guard
(
fluid
.
Program
(),
fluid
.
Program
()):
data_file
=
fluid
.
layers
.
io
.
open_recordio_file
(
data_file
=
open_recordio_file
(
'./mnist_for_preprocessor_test.recordio'
,
'./mnist_for_preprocessor_test.recordio'
,
shapes
=
[[
-
1
,
784
],
[
-
1
,
1
]],
shapes
=
[[
-
1
,
784
],
[
-
1
,
1
]],
lod_levels
=
[
0
,
0
],
lod_levels
=
[
0
,
0
],
...
...
python/paddle/fluid/tests/unittests/test_recordio_reader.py
浏览文件 @
ecc4dc6d
...
@@ -19,6 +19,7 @@ import unittest
...
@@ -19,6 +19,7 @@ import unittest
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
paddle
import
paddle
import
paddle.dataset.mnist
as
mnist
import
paddle.dataset.mnist
as
mnist
from
paddle.fluid.layers.io
import
open_recordio_file
class
TestRecordIO
(
unittest
.
TestCase
):
class
TestRecordIO
(
unittest
.
TestCase
):
...
@@ -40,7 +41,7 @@ class TestRecordIO(unittest.TestCase):
...
@@ -40,7 +41,7 @@ class TestRecordIO(unittest.TestCase):
def
test_main
(
self
,
decorator_callback
=
None
):
def
test_main
(
self
,
decorator_callback
=
None
):
# use new program
# use new program
with
fluid
.
program_guard
(
fluid
.
Program
(),
fluid
.
Program
()):
with
fluid
.
program_guard
(
fluid
.
Program
(),
fluid
.
Program
()):
data_file
=
fluid
.
layers
.
open_recordio_file
(
data_file
=
open_recordio_file
(
'./mnist.recordio'
,
'./mnist.recordio'
,
shapes
=
[[
-
1
,
784
],
[
-
1
,
1
]],
shapes
=
[[
-
1
,
784
],
[
-
1
,
1
]],
lod_levels
=
[
0
,
0
],
lod_levels
=
[
0
,
0
],
...
...
python/paddle/fluid/tests/unittests/transformer_model.py
浏览文件 @
ecc4dc6d
...
@@ -19,6 +19,7 @@ import numpy as np
...
@@ -19,6 +19,7 @@ import numpy as np
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
paddle.fluid.layers
as
layers
import
paddle.fluid.layers
as
layers
from
paddle.fluid.layers.io
import
open_recordio_file
pos_enc_param_names
=
(
pos_enc_param_names
=
(
"src_pos_enc_table"
,
"src_pos_enc_table"
,
...
@@ -405,7 +406,7 @@ def transformer(
...
@@ -405,7 +406,7 @@ def transformer(
src_pad_idx
,
src_pad_idx
,
trg_pad_idx
,
trg_pad_idx
,
pos_pad_idx
,
):
pos_pad_idx
,
):
file_obj
=
fluid
.
layers
.
open_recordio_file
(
file_obj
=
open_recordio_file
(
filename
=
'/tmp/wmt16.recordio'
,
filename
=
'/tmp/wmt16.recordio'
,
shapes
=
[
shapes
=
[
[
batch_size
*
max_length
,
1
],
[
batch_size
*
max_length
,
1
],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录