Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
75f81233
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看板
未验证
提交
75f81233
编写于
2月 18, 2021
作者:
C
Chen Weihang
提交者:
GitHub
2月 19, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix regex error & simplify marco name (#31031)
上级
f0ee1592
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
5 addition
and
7 deletion
+5
-7
paddle/fluid/extension/include/op_meta_info.h
paddle/fluid/extension/include/op_meta_info.h
+2
-2
paddle/fluid/extension/src/tensor.cc
paddle/fluid/extension/src/tensor.cc
+0
-2
python/paddle/fluid/tests/custom_op/relu_op3_simple.cc
python/paddle/fluid/tests/custom_op/relu_op3_simple.cc
+1
-1
python/paddle/fluid/tests/custom_op/relu_op_simple.cc
python/paddle/fluid/tests/custom_op/relu_op_simple.cc
+1
-1
python/paddle/utils/cpp_extension/extension_utils.py
python/paddle/utils/cpp_extension/extension_utils.py
+1
-1
未找到文件。
paddle/fluid/extension/include/op_meta_info.h
浏览文件 @
75f81233
...
...
@@ -290,12 +290,12 @@ class OpMetaInfoBuilder {
/////////////////////// Op register API /////////////////////////
// For inference: compile directly with framework
// Call after PD_BUILD_OP
ERATOR
(...)
// Call after PD_BUILD_OP(...)
void
RegisterAllCustomOperator
();
/////////////////////// Op register Macro /////////////////////////
#define PD_BUILD_OP
ERATOR(op_name)
\
#define PD_BUILD_OP
(op_name)
\
static ::paddle::OpMetaInfoBuilder __op_meta_info_##__COUNTER__##__ = \
::paddle::OpMetaInfoBuilder(op_name)
...
...
paddle/fluid/extension/src/tensor.cc
浏览文件 @
75f81233
...
...
@@ -125,8 +125,6 @@ T *Tensor::mutable_data() {
#ifdef PADDLE_WITH_CUDA
case
static_cast
<
int
>
(
PlaceType
::
kGPU
):
{
int
device_num
=
platform
::
GetCurrentDeviceId
();
VLOG
(
1
)
<<
"Custom Operator: mutable data cuda device id - "
<<
device_num
;
return
tensor
->
mutable_data
<
T
>
(
platform
::
CUDAPlace
(
device_num
));
}
#endif
...
...
python/paddle/fluid/tests/custom_op/relu_op3_simple.cc
浏览文件 @
75f81233
...
...
@@ -31,7 +31,7 @@ std::vector<paddle::DataType> ReluInferDType(paddle::DataType x_dtype);
// Reuse codes in `relu_op_simple.cc/cu` to register another custom operator
// to test jointly compile multi operators at same time.
PD_BUILD_OP
ERATOR
(
"relu3"
)
PD_BUILD_OP
(
"relu3"
)
.
Inputs
({
"X"
})
.
Outputs
({
"Out"
})
.
SetKernelFn
(
PD_KERNEL
(
ReluForward
))
...
...
python/paddle/fluid/tests/custom_op/relu_op_simple.cc
浏览文件 @
75f81233
...
...
@@ -104,7 +104,7 @@ std::vector<paddle::DataType> ReluInferDType(paddle::DataType x_dtype) {
return
{
x_dtype
};
}
PD_BUILD_OP
ERATOR
(
"relu2"
)
PD_BUILD_OP
(
"relu2"
)
.
Inputs
({
"X"
})
.
Outputs
({
"Out"
})
.
SetKernelFn
(
PD_KERNEL
(
ReluForward
))
...
...
python/paddle/utils/cpp_extension/extension_utils.py
浏览文件 @
75f81233
...
...
@@ -612,7 +612,7 @@ def parse_op_name_from(sources):
def
regex
(
content
):
if
USING_NEW_CUSTOM_OP_LOAD_METHOD
:
pattern
=
re
.
compile
(
r
'
BUILD_OPERATOR\(([^,]+),
'
)
pattern
=
re
.
compile
(
r
'
PD_BUILD_OP\(([^,\)]+)\)
'
)
else
:
pattern
=
re
.
compile
(
r
'REGISTER_OPERATOR\(([^,]+),'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录