Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
0cdca676
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
0cdca676
编写于
11月 22, 2022
作者:
H
HongyuJia
提交者:
GitHub
11月 22, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix typo error (#48156)
上级
91f4d1ce
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
12 addition
and
15 deletion
+12
-15
paddle/fluid/framework/custom_operator.cc
paddle/fluid/framework/custom_operator.cc
+5
-7
paddle/fluid/framework/grad_op_desc_maker.h
paddle/fluid/framework/grad_op_desc_maker.h
+1
-1
paddle/fluid/framework/op_desc.h
paddle/fluid/framework/op_desc.h
+1
-1
paddle/fluid/framework/op_proto_maker.cc
paddle/fluid/framework/op_proto_maker.cc
+2
-2
paddle/fluid/operators/ops_extra_info.h
paddle/fluid/operators/ops_extra_info.h
+1
-1
paddle/phi/api/ext/op_meta_info.h
paddle/phi/api/ext/op_meta_info.h
+2
-3
未找到文件。
paddle/fluid/framework/custom_operator.cc
浏览文件 @
0cdca676
...
...
@@ -513,8 +513,8 @@ Custom Operator.
According to the phi::DenseTensor operation function implemented by the user
independently of the framework, it is encapsulated into a framework
operator to adapt to various execution scenarios such as dynamic graph
,
mode static graph mode, and inference mode.
operator to adapt to various execution scenarios such as dynamic graph
mode
,
static graph mode, and inference mode.
)DOC"
);
}
...
...
@@ -979,11 +979,9 @@ void RegisterOperatorWithMetaInfo(const std::vector<OpMetaInfo>& op_meta_infos,
"Custom grad operator infershape error. "
"If a custom grad operator contains only one input and "
"only one output, the input shape will be directly set "
"to "
"the output shape. Otherwise, Please set the forward "
"input "
"as the grad operator's input or set the InferShapeFn "
"of custom grad operator by "
"to the output shape. Otherwise, Please set the forward "
"input as the grad operator's input or set the "
"InferShapeFn of custom grad operator by "
".SetInferShapeFn(PD_INFER_SHAPE(...))"
));
ctx
->
ShareDim
(
grad_op_inputs
[
0
],
out_name
);
}
...
...
paddle/fluid/framework/grad_op_desc_maker.h
浏览文件 @
0cdca676
...
...
@@ -56,7 +56,7 @@ using GradOpPtr = typename details::GradOpPtrTrait<T>::Type;
operator fwd_op. After it is called (through operator()), the pairs of
(gradient variable, corresponding input variable of fwd_op) will be added to
grad_to_var. If an input variable of fwd_op is contained in no_grad_set, its
gradient varia
lb
e will be ignored or kEmptyVarName depending on the template
gradient varia
bl
e will be ignored or kEmptyVarName depending on the template
argument DropEmptyIG in the derived classes.
*/
class
GradOpDescMakerBase
{
...
...
paddle/fluid/framework/op_desc.h
浏览文件 @
0cdca676
...
...
@@ -217,7 +217,7 @@ class OpDesc {
return
ret_val
;
}
// it it really needed? or just mantain a ptr from block?
// it it really needed? or just ma
i
ntain a ptr from block?
proto
::
OpDesc
desc_
;
BlockDesc
*
block_
{
nullptr
};
// not_own
// input arg name => input variable names
...
...
paddle/fluid/framework/op_proto_maker.cc
浏览文件 @
0cdca676
...
...
@@ -98,12 +98,12 @@ void OpProtoAndCheckerMaker::operator()(proto::OpProto* proto,
.
SetDefault
({})
.
AsExtra
();
AddAttr
<
std
::
string
>
(
OpNamescopeAttrName
(),
"Operator name with namesope."
)
AddAttr
<
std
::
string
>
(
OpNamescopeAttrName
(),
"Operator name with names
c
ope."
)
.
SetDefault
(
""
)
.
AsExtra
();
AddAttr
<
std
::
vector
<
std
::
string
>>
(
OpCreationCallstackAttrName
(),
"Callstack for Op Creat
at
ion."
)
"Callstack for Op Creation."
)
.
SetDefault
({})
.
AsExtra
();
AddAttr
<
std
::
string
>
(
OpDeviceAttrName
(),
"Device type of this operator."
)
...
...
paddle/fluid/operators/ops_extra_info.h
浏览文件 @
0cdca676
...
...
@@ -37,7 +37,7 @@ enum class ExtraAttrProperty : uint8_t {
SCHEDULE
,
// The attributes for ONEDNN only, can be saved in OneDNNContext
ONEDNN
,
// The attributes for
ONE
DNN only, can be saved in GPUContext
// The attributes for
GPU
DNN only, can be saved in GPUContext
GPUDNN
,
// Add necessary properties as needed
};
...
...
paddle/phi/api/ext/op_meta_info.h
浏览文件 @
0cdca676
...
...
@@ -271,7 +271,7 @@ struct KernelFuncImpl<Return (*)(Args...), impl_fn> {
static
void
Compute
(
CustomOpKernelContext
*
ctx
,
const
Args
&
...
args
)
{
static_assert
(
out_idx
==
0
,
"If return std::vector<Tensor> in Custom OpKernel, "
"you cannot pass output by kernel func
it
on argument."
);
"you cannot pass output by kernel func
ti
on argument."
);
auto
outs
=
impl_fn
(
args
...);
auto
*
orig_outs
=
ctx
->
AllMutableOutput
();
PD_CHECK
(
orig_outs
->
size
()
==
outs
.
size
(),
...
...
@@ -626,8 +626,7 @@ class PADDLE_API OpMetaInfoBuilder {
void
RegisterAllCustomOperator
();
// Using this api to load compiled custom operator's dynamic library and
// register Custom
// Operator into it
// register Custom Operator into it
void
LoadCustomOperatorLib
(
const
std
::
string
&
dso_name
);
/////////////////////// Op register Macro /////////////////////////
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录