Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
b3c5808e
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2297
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b3c5808e
编写于
6月 30, 2017
作者:
G
gongweibao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rm cloud EOF
上级
b79784ee
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
1 addition
and
21 deletion
+1
-21
go/master/c/client.go
go/master/c/client.go
+0
-7
go/master/client.go
go/master/client.go
+0
-3
go/master/client_test.go
go/master/client_test.go
+1
-6
python/paddle/v2/master/client.py
python/paddle/v2/master/client.py
+0
-5
未找到文件。
go/master/c/client.go
浏览文件 @
b3c5808e
...
...
@@ -13,7 +13,6 @@ typedef int paddle_master_client;
import
"C"
import
(
"io"
"sync"
"unsafe"
...
...
@@ -93,12 +92,6 @@ func paddle_set_dataset(client C.paddle_master_client, path **C.char, size C.int
func
paddle_next_record
(
client
C
.
paddle_master_client
,
record
**
C
.
uchar
)
C
.
int
{
c
:=
get
(
client
)
r
,
err
:=
c
.
NextRecord
()
if
err
==
io
.
EOF
{
// EOF
*
record
=
(
*
C
.
uchar
)(
nullPtr
)
return
-
1
}
if
err
!=
nil
{
// Error
// TODO: return the type of error?
...
...
go/master/client.go
浏览文件 @
b3c5808e
package
master
import
(
"io"
"os"
"time"
...
...
@@ -70,8 +69,6 @@ func (c *Client) getRecords() {
if
err
!=
nil
{
log
.
Errorln
(
err
)
}
c
.
ch
<-
record
{
nil
,
io
.
EOF
}
}
// We treat a task as finished whenever the last data
...
...
go/master/client_test.go
浏览文件 @
b3c5808e
...
...
@@ -2,7 +2,6 @@ package master_test
import
(
"fmt"
"io"
"net"
"net/http"
"net/rpc"
...
...
@@ -70,12 +69,8 @@ func TestNextRecord(t *testing.T) {
for
pass
:=
0
;
pass
<
50
;
pass
++
{
received
:=
make
(
map
[
byte
]
bool
)
for
i
:=
0
;
i
<
=
total
;
i
++
{
for
i
:=
0
;
i
<
total
;
i
++
{
r
,
err
:=
c
.
NextRecord
()
if
err
==
io
.
EOF
{
break
}
if
err
!=
nil
{
t
.
Fatal
(
pass
,
i
,
"Read error:"
,
err
)
}
...
...
python/paddle/v2/master/client.py
浏览文件 @
b3c5808e
...
...
@@ -28,16 +28,11 @@ class client(object):
# return format: (record, errno)
# errno = 0: ok
# = -1: EOF
# < -1: error
def
next_record
(
self
):
p
=
ctypes
.
c_char_p
()
ret
=
ctypes
.
pointer
(
p
)
size
=
lib
.
paddle_next_record
(
self
.
c
,
ret
)
if
size
==
-
1
:
# EOF
return
None
,
-
1
if
size
<
-
1
:
# Error
return
None
,
size
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录