Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
b3c5808e
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
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;
...
@@ -13,7 +13,6 @@ typedef int paddle_master_client;
import
"C"
import
"C"
import
(
import
(
"io"
"sync"
"sync"
"unsafe"
"unsafe"
...
@@ -93,12 +92,6 @@ func paddle_set_dataset(client C.paddle_master_client, path **C.char, size C.int
...
@@ -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
{
func
paddle_next_record
(
client
C
.
paddle_master_client
,
record
**
C
.
uchar
)
C
.
int
{
c
:=
get
(
client
)
c
:=
get
(
client
)
r
,
err
:=
c
.
NextRecord
()
r
,
err
:=
c
.
NextRecord
()
if
err
==
io
.
EOF
{
// EOF
*
record
=
(
*
C
.
uchar
)(
nullPtr
)
return
-
1
}
if
err
!=
nil
{
if
err
!=
nil
{
// Error
// Error
// TODO: return the type of error?
// TODO: return the type of error?
...
...
go/master/client.go
浏览文件 @
b3c5808e
package
master
package
master
import
(
import
(
"io"
"os"
"os"
"time"
"time"
...
@@ -70,8 +69,6 @@ func (c *Client) getRecords() {
...
@@ -70,8 +69,6 @@ func (c *Client) getRecords() {
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Errorln
(
err
)
log
.
Errorln
(
err
)
}
}
c
.
ch
<-
record
{
nil
,
io
.
EOF
}
}
}
// We treat a task as finished whenever the last data
// We treat a task as finished whenever the last data
...
...
go/master/client_test.go
浏览文件 @
b3c5808e
...
@@ -2,7 +2,6 @@ package master_test
...
@@ -2,7 +2,6 @@ package master_test
import
(
import
(
"fmt"
"fmt"
"io"
"net"
"net"
"net/http"
"net/http"
"net/rpc"
"net/rpc"
...
@@ -70,12 +69,8 @@ func TestNextRecord(t *testing.T) {
...
@@ -70,12 +69,8 @@ func TestNextRecord(t *testing.T) {
for
pass
:=
0
;
pass
<
50
;
pass
++
{
for
pass
:=
0
;
pass
<
50
;
pass
++
{
received
:=
make
(
map
[
byte
]
bool
)
received
:=
make
(
map
[
byte
]
bool
)
for
i
:=
0
;
i
<
=
total
;
i
++
{
for
i
:=
0
;
i
<
total
;
i
++
{
r
,
err
:=
c
.
NextRecord
()
r
,
err
:=
c
.
NextRecord
()
if
err
==
io
.
EOF
{
break
}
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
pass
,
i
,
"Read error:"
,
err
)
t
.
Fatal
(
pass
,
i
,
"Read error:"
,
err
)
}
}
...
...
python/paddle/v2/master/client.py
浏览文件 @
b3c5808e
...
@@ -28,16 +28,11 @@ class client(object):
...
@@ -28,16 +28,11 @@ class client(object):
# return format: (record, errno)
# return format: (record, errno)
# errno = 0: ok
# errno = 0: ok
# = -1: EOF
# < -1: error
# < -1: error
def
next_record
(
self
):
def
next_record
(
self
):
p
=
ctypes
.
c_char_p
()
p
=
ctypes
.
c_char_p
()
ret
=
ctypes
.
pointer
(
p
)
ret
=
ctypes
.
pointer
(
p
)
size
=
lib
.
paddle_next_record
(
self
.
c
,
ret
)
size
=
lib
.
paddle_next_record
(
self
.
c
,
ret
)
if
size
==
-
1
:
# EOF
return
None
,
-
1
if
size
<
-
1
:
if
size
<
-
1
:
# Error
# Error
return
None
,
size
return
None
,
size
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录