Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
9fb68c7c
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
9fb68c7c
编写于
4月 03, 2020
作者:
X
xiaogang
提交者:
GitHub
4月 03, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: add train flag for add_kernel and add_operator to control grad_ops (#3316)
上级
3b49256a
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
18 addition
and
15 deletion
+18
-15
cmake/lite.cmake
cmake/lite.cmake
+6
-1
lite/kernels/arm/CMakeLists.txt
lite/kernels/arm/CMakeLists.txt
+6
-7
lite/operators/CMakeLists.txt
lite/operators/CMakeLists.txt
+6
-7
未找到文件。
cmake/lite.cmake
浏览文件 @
9fb68c7c
...
...
@@ -307,6 +307,9 @@ function(add_kernel TARGET device level)
if
(
"
${
level
}
"
STREQUAL
"extra"
AND
(
NOT LITE_BUILD_EXTRA
))
return
()
endif
()
if
(
"
${
level
}
"
STREQUAL
"train"
AND
(
NOT LITE_WITH_TRAIN
))
return
()
endif
()
if
(
"
${
device
}
"
STREQUAL
"Host"
)
...
...
@@ -434,11 +437,13 @@ function(add_operator TARGET level)
ARGS
)
cmake_parse_arguments
(
args
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
if
(
"
${
level
}
"
STREQUAL
"extra"
AND
(
NOT LITE_BUILD_EXTRA
))
return
()
endif
()
if
(
"
${
level
}
"
STREQUAL
"train"
AND
(
NOT LITE_WITH_TRAIN
))
return
()
endif
()
foreach
(
src
${
args_SRCS
}
)
if
(
LITE_BUILD_TAILOR
)
...
...
lite/kernels/arm/CMakeLists.txt
浏览文件 @
9fb68c7c
...
...
@@ -106,13 +106,12 @@ add_kernel(lstm_arm ARM extra SRCS lstm_compute.cc DEPS ${lite_kernel_deps} math
# 4. training kernels
add_kernel
(
mean_compute_arm ARM extra SRCS mean_compute.cc DEPS
${
lite_kernel_deps
}
math_arm
)
if
(
LITE_WITH_TRAIN
)
add_kernel
(
mean_grad_compute_arm ARM extra SRCS mean_grad_compute.cc DEPS
${
lite_kernel_deps
}
math_arm
)
add_kernel
(
activation_grad_compute_arm ARM basic SRCS activation_grad_compute.cc DEPS
${
lite_kernel_deps
}
math_arm
)
add_kernel
(
elementwise_grad_compute_arm ARM basic SRCS elementwise_grad_compute.cc DEPS
${
lite_kernel_deps
}
math_arm
)
add_kernel
(
mul_grad_compute_arm ARM extra SRCS mul_grad_compute.cc DEPS
${
lite_kernel_deps
}
math_arm
)
add_kernel
(
sgd_compute_arm ARM extra SRCS sgd_compute.cc DEPS
${
lite_kernel_deps
}
math_arm
)
endif
()
add_kernel
(
mean_grad_compute_arm ARM train SRCS mean_grad_compute.cc DEPS
${
lite_kernel_deps
}
math_arm
)
add_kernel
(
activation_grad_compute_arm ARM train SRCS activation_grad_compute.cc DEPS
${
lite_kernel_deps
}
math_arm
)
add_kernel
(
elementwise_grad_compute_arm ARM train SRCS elementwise_grad_compute.cc DEPS
${
lite_kernel_deps
}
math_arm
)
add_kernel
(
mul_grad_compute_arm ARM train SRCS mul_grad_compute.cc DEPS
${
lite_kernel_deps
}
math_arm
)
add_kernel
(
sgd_compute_arm ARM train SRCS sgd_compute.cc DEPS
${
lite_kernel_deps
}
math_arm
)
lite_cc_test
(
test_scale_compute_arm SRCS scale_compute_test.cc DEPS scale_compute_arm
)
lite_cc_test
(
test_softmax_compute_arm SRCS softmax_compute_test.cc DEPS softmax_compute_arm
)
...
...
lite/operators/CMakeLists.txt
浏览文件 @
9fb68c7c
...
...
@@ -141,13 +141,12 @@ add_operator(lstm_op extra SRCS lstm_op.cc DEPS ${op_DEPS})
# 4. training op
add_operator
(
mean_op extra SRCS mean_op.cc DEPS
${
op_DEPS
}
)
if
(
LITE_WITH_TRAIN
)
add_operator
(
mean_grad_op extra SRCS mean_grad_op.cc DEPS
${
op_DEPS
}
)
add_operator
(
activation_grad_ops basic SRCS activation_grad_ops.cc DEPS
${
op_DEPS
}
)
add_operator
(
elementwise_grad_op extra SRCS elementwise_grad_ops.cc DEPS
${
op_DEPS
}
)
add_operator
(
mul_grad_op basic SRCS mul_grad_op.cc DEPS
${
op_DEPS
}
)
add_operator
(
sgd_op extra SRCS sgd_op.cc DEPS
${
op_DEPS
}
)
endif
()
add_operator
(
mean_grad_op train SRCS mean_grad_op.cc DEPS
${
op_DEPS
}
)
add_operator
(
activation_grad_ops train SRCS activation_grad_ops.cc DEPS
${
op_DEPS
}
)
add_operator
(
elementwise_grad_op train SRCS elementwise_grad_ops.cc DEPS
${
op_DEPS
}
)
add_operator
(
mul_grad_op train SRCS mul_grad_op.cc DEPS
${
op_DEPS
}
)
add_operator
(
sgd_op train SRCS sgd_op.cc DEPS
${
op_DEPS
}
)
if
(
NOT LITE_WITH_X86
)
lite_cc_test
(
test_fc_op SRCS fc_op_test.cc
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录