Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
30a6f9b3
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
1 年多 前同步成功
通知
696
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
30a6f9b3
编写于
8年前
作者:
Y
Yu Yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Start doing shared c_api library
上级
88c38623
无相关合并请求
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
6 deletion
+10
-6
paddle/capi/CMakeLists.txt
paddle/capi/CMakeLists.txt
+4
-0
paddle/capi/GradientMachine.cpp
paddle/capi/GradientMachine.cpp
+6
-6
未找到文件。
paddle/capi/CMakeLists.txt
浏览文件 @
30a6f9b3
...
...
@@ -55,6 +55,10 @@ add_custom_target(paddle_capi_whole ALL
set_target_properties
(
paddle_capi_whole
PROPERTIES IMPORTED_LOCATION
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
capi_whole_library
}
)
add_library
(
paddle_capi_shared SHARED
${
CAPI_SOURCES
}
)
target_include_directories
(
paddle_capi_shared PUBLIC
${
CMAKE_CURRENT_BINARY_DIR
}
)
link_paddle_exe
(
paddle_capi_shared
)
# install library & headers.
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
capi_whole_library
}
DESTINATION lib
)
install
(
FILES
${
CAPI_HEADER
}
DESTINATION include/paddle
)
...
...
This diff is collapsed.
Click to expand it.
paddle/capi/GradientMachine.cpp
浏览文件 @
30a6f9b3
...
...
@@ -38,7 +38,7 @@ NeuralNetwork* newCustomNerualNetwork(const std::string& name,
}
// namespace paddle
extern
"C"
{
int
PDGradientMachineCreateForPredict
(
PD_Gradie
m
tMachine
*
machine
,
int
PDGradientMachineCreateForPredict
(
PD_Gradie
n
tMachine
*
machine
,
void
*
modelConfigProtobuf
,
int
size
)
{
if
(
modelConfigProtobuf
==
nullptr
)
return
kPD_NULLPTR
;
...
...
@@ -55,12 +55,12 @@ int PDGradientMachineCreateForPredict(PD_GradiemtMachine* machine,
return
kPD_NO_ERROR
;
}
int
PDGradientMachineDestroy
(
PD_Gradie
m
tMachine
machine
)
{
int
PDGradientMachineDestroy
(
PD_Gradie
n
tMachine
machine
)
{
delete
cast
(
machine
);
return
kPD_NO_ERROR
;
}
int
PDGradientMachineLoadParameterFromDisk
(
PD_Gradie
m
tMachine
machine
,
int
PDGradientMachineLoadParameterFromDisk
(
PD_Gradie
n
tMachine
machine
,
const
char
*
path
)
{
auto
m
=
cast
(
machine
);
if
(
m
==
nullptr
||
path
==
nullptr
||
m
->
machine
==
nullptr
)
...
...
@@ -69,7 +69,7 @@ int PDGradientMachineLoadParameterFromDisk(PD_GradiemtMachine machine,
return
kPD_NO_ERROR
;
}
int
PDGradientMachineForward
(
PD_Gradie
m
tMachine
machine
,
int
PDGradientMachineForward
(
PD_Gradie
n
tMachine
machine
,
PD_Arguments
inArgs
,
PD_Arguments
outArgs
,
bool
isTrain
)
{
...
...
@@ -83,10 +83,10 @@ int PDGradientMachineForward(PD_GradiemtMachine machine,
return
kPD_NO_ERROR
;
}
int
PDGradientMachineCreateSharedParam
(
PD_Gradie
m
tMachine
origin
,
int
PDGradientMachineCreateSharedParam
(
PD_Gradie
n
tMachine
origin
,
void
*
modelConfigProtobuf
,
int
size
,
PD_Gradie
m
tMachine
*
slave
)
{
PD_Gradie
n
tMachine
*
slave
)
{
auto
o
=
cast
(
origin
);
if
(
origin
==
nullptr
||
slave
==
nullptr
||
o
->
machine
==
nullptr
)
{
return
kPD_NULLPTR
;
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
反馈
建议
客服
返回
顶部