Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sven357
Paddle
提交
f6fe3715
P
Paddle
项目概览
sven357
/
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,发现更多精彩内容 >>
提交
f6fe3715
编写于
7月 13, 2017
作者:
Q
qijun
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'baidu/develop' into fix_bug_dynload
上级
4e918377
728665d7
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
36 addition
and
10 deletion
+36
-10
CMakeLists.txt
CMakeLists.txt
+6
-2
cmake/cross_compiling/android.cmake
cmake/cross_compiling/android.cmake
+7
-0
cmake/external/openblas.cmake
cmake/external/openblas.cmake
+6
-1
cmake/generic.cmake
cmake/generic.cmake
+2
-2
go/cmd/pserver/pserver.go
go/cmd/pserver/pserver.go
+1
-1
go/pserver/service.go
go/pserver/service.go
+4
-4
paddle/framework/op_registry.h
paddle/framework/op_registry.h
+1
-0
paddle/framework/operator.h
paddle/framework/operator.h
+4
-0
paddle/framework/operator_test.cc
paddle/framework/operator_test.cc
+5
-0
未找到文件。
CMakeLists.txt
浏览文件 @
f6fe3715
...
...
@@ -28,7 +28,9 @@ if(NOT CMAKE_CROSSCOMPILING)
endif
(
NOT CMAKE_CROSSCOMPILING
)
find_package
(
Git REQUIRED
)
find_package
(
Threads REQUIRED
)
find_package
(
Boost QUIET
)
if
(
NOT ANDROID
)
find_package
(
Boost QUIET
)
endif
()
include
(
simd
)
...
...
@@ -151,7 +153,9 @@ if(WITH_GOLANG)
endif
(
WITH_GOLANG
)
add_subdirectory
(
paddle
)
add_subdirectory
(
python
)
if
(
WITH_PYTHON
)
add_subdirectory
(
python
)
endif
()
if
(
WITH_DOC
)
add_subdirectory
(
doc
)
endif
()
cmake/cross_compiling/android.cmake
浏览文件 @
f6fe3715
...
...
@@ -106,6 +106,9 @@ IF("${CMAKE_VERSION}" VERSION_LESS "3.7.0")
SET
(
CMAKE_SYSTEM_PROCESSOR armv7-a
)
ENDIF
()
ENDIF
()
IF
(
ANDROID_ABI STREQUAL
"arm64-v8a"
)
SET
(
ANDROID_TOOLCHAIN_NAME aarch64-linux-android
)
ENDIF
()
SET
(
ANDROID_TOOLCHAIN_PREFIX
"
${
ANDROID_TOOLCHAIN_ROOT
}
/bin/
${
ANDROID_TOOLCHAIN_NAME
}
-"
)
ENDIF
()
...
...
@@ -162,6 +165,10 @@ IF("${CMAKE_VERSION}" VERSION_LESS "3.7.0")
ENDIF
()
ENDIF
()
IF
(
ANDROID_ABI STREQUAL
"arm64-v8a"
)
LIST
(
APPEND ANDROID_COMPILER_FLAGS -march=armv8-a
)
ENDIF
()
STRING
(
REPLACE
";"
" "
ANDROID_COMPILER_FLAGS
"
${
ANDROID_COMPILER_FLAGS
}
"
)
STRING
(
REPLACE
";"
" "
ANDROID_LINKER_FLAGS
"
${
ANDROID_LINKER_FLAGS
}
"
)
...
...
cmake/external/openblas.cmake
浏览文件 @
f6fe3715
...
...
@@ -32,7 +32,12 @@ IF(NOT ${CBLAS_FOUND})
# arm_soft_fp_abi branch of OpenBLAS to support softfp
# https://github.com/xianyi/OpenBLAS/tree/arm_soft_fp_abi
SET
(
OPENBLAS_COMMIT
"b5c96fcfcdc82945502a2303116a64d89985daf5"
)
SET
(
OPTIONAL_ARGS HOSTCC=
${
HOST_C_COMPILER
}
TARGET=ARMV7 ARM_SOFTFP_ABI=1 USE_THREAD=0
)
IF
(
ANDROID_ABI MATCHES
"^armeabi(-v7a)?$"
)
SET
(
TARGET
"ARMV7"
)
ELSEIF
(
ANDROID_ABI STREQUAL
"arm64-v8a"
)
SET
(
TARGET
"ARMV8"
)
ENDIF
()
SET
(
OPTIONAL_ARGS HOSTCC=
${
HOST_C_COMPILER
}
TARGET=
${
TARGET
}
ARM_SOFTFP_ABI=1 USE_THREAD=0
)
ELSEIF
(
RPI
)
# use hardfp
SET
(
OPENBLAS_COMMIT
"v0.2.19"
)
...
...
cmake/generic.cmake
浏览文件 @
f6fe3715
...
...
@@ -90,11 +90,11 @@
# including binary directory for generated headers.
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
if
(
NOT APPLE
)
if
(
NOT APPLE
AND NOT ANDROID
)
find_package
(
Threads REQUIRED
)
link_libraries
(
${
CMAKE_THREAD_LIBS_INIT
}
)
set
(
CMAKE_CXX_LINK_EXECUTABLE
"
${
CMAKE_CXX_LINK_EXECUTABLE
}
-ldl -lrt"
)
endif
(
NOT APPLE
)
endif
(
NOT APPLE
AND NOT ANDROID
)
function
(
merge_static_libs TARGET_NAME
)
set
(
libs
${
ARGN
}
)
...
...
go/cmd/pserver/pserver.go
浏览文件 @
f6fe3715
...
...
@@ -34,7 +34,7 @@ func main() {
var
idx
int
var
cp
*
pserver
.
Checkpoint
var
cp
pserver
.
Checkpoint
var
e
*
pserver
.
EtcdClient
if
*
index
>=
0
{
idx
=
*
index
...
...
go/pserver/service.go
浏览文件 @
f6fe3715
...
...
@@ -83,7 +83,7 @@ type parameterCheckpoint struct {
}
// NewCheckpointFromFile loads parameters and state from checkpoint file
func
NewCheckpointFromFile
(
cpPath
string
,
idx
int
,
e
*
EtcdClient
)
(
*
Checkpoint
,
error
)
{
func
NewCheckpointFromFile
(
cpPath
string
,
idx
int
,
e
*
EtcdClient
)
(
Checkpoint
,
error
)
{
v
,
err
:=
e
.
GetKey
(
PsPath
+
string
(
idx
),
3
*
time
.
Second
)
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -110,7 +110,7 @@ func NewCheckpointFromFile(cpPath string, idx int, e *EtcdClient) (*Checkpoint,
}
dec
:=
gob
.
NewDecoder
(
bytes
.
NewReader
(
content
))
cp
:=
&
Checkpoint
{}
cp
:=
Checkpoint
{}
if
err
=
dec
.
Decode
(
cp
);
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -119,7 +119,7 @@ func NewCheckpointFromFile(cpPath string, idx int, e *EtcdClient) (*Checkpoint,
// NewService creates a new service, will bypass etcd registration if no
// endpoints specified. It will recovery from checkpoint file if a exists a specified checkpoint.
func
NewService
(
idx
int
,
interval
time
.
Duration
,
path
string
,
client
*
EtcdClient
,
cp
*
Checkpoint
)
(
*
Service
,
error
)
{
func
NewService
(
idx
int
,
interval
time
.
Duration
,
path
string
,
client
*
EtcdClient
,
cp
Checkpoint
)
(
*
Service
,
error
)
{
s
:=
&
Service
{
idx
:
idx
,
checkpointInterval
:
interval
,
...
...
@@ -130,7 +130,7 @@ func NewService(idx int, interval time.Duration, path string, client *EtcdClient
s
.
initialized
=
make
(
chan
struct
{})
if
cp
!=
nil
{
for
_
,
item
:=
range
*
cp
{
for
_
,
item
:=
range
cp
{
p
:=
ParameterWithConfig
{
Param
:
item
.
Param
,
Config
:
item
.
Config
,
...
...
paddle/framework/op_registry.h
浏览文件 @
f6fe3715
...
...
@@ -119,6 +119,7 @@ class OpRegistry {
op
->
attrs_
[
attr
.
name
()]
=
AttrTypeHelper
::
GetAttrValue
(
attr
);
}
op_checkers
().
at
(
op_type
).
Check
(
op
->
attrs_
);
op
->
Init
();
return
op
;
}
...
...
paddle/framework/operator.h
浏览文件 @
f6fe3715
...
...
@@ -49,6 +49,10 @@ class OperatorBase {
std
::
string
DebugString
()
const
;
/// Init will be called after CreateOperator, you can put some initialization
/// logic here.
virtual
void
Init
()
{}
/// InferShape infer the size of Variables used by this Operator with
/// information inside scope
virtual
void
InferShape
(
const
std
::
shared_ptr
<
Scope
>&
scope
)
const
=
0
;
...
...
paddle/framework/operator_test.cc
浏览文件 @
f6fe3715
...
...
@@ -21,14 +21,19 @@ namespace framework {
class
OperatorTest
:
public
OperatorBase
{
public:
void
Init
()
override
{
x
=
1
;
}
void
InferShape
(
const
std
::
shared_ptr
<
Scope
>&
scope
)
const
override
{}
void
Run
(
const
std
::
shared_ptr
<
Scope
>&
scope
,
const
platform
::
DeviceContext
&
dev_ctx
)
const
override
{
float
scale
=
GetAttr
<
float
>
(
"scale"
);
ASSERT_NEAR
(
scale
,
3.14
,
1e-5
);
ASSERT_EQ
(
scope
->
GetVariable
(
inputs_
[
0
]),
nullptr
);
ASSERT_EQ
(
x
,
1
);
ASSERT_NE
(
scope
->
GetVariable
(
outputs_
[
0
]),
nullptr
);
}
public:
float
x
=
0
;
};
class
OperatorTestProtoAndCheckerMaker
:
public
OpProtoAndCheckerMaker
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录