Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
ee4eecef
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
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看板
未验证
提交
ee4eecef
编写于
5月 23, 2023
作者:
C
co63oc
提交者:
GitHub
5月 23, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix typos, Betweeen to Between (#53952)
* Fix typos * Fix
上级
c36a000d
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
25 addition
and
25 deletion
+25
-25
paddle/fluid/eager/auto_code_generator/eager_generator.cc
paddle/fluid/eager/auto_code_generator/eager_generator.cc
+6
-6
paddle/fluid/eager/custom_operator/custom_operator_node.cc
paddle/fluid/eager/custom_operator/custom_operator_node.cc
+3
-3
paddle/fluid/pybind/eager_functions.cc
paddle/fluid/pybind/eager_functions.cc
+3
-3
paddle/fluid/pybind/eager_legacy_op_function_generator.cc
paddle/fluid/pybind/eager_legacy_op_function_generator.cc
+6
-6
paddle/phi/api/ext/op_meta_info.h
paddle/phi/api/ext/op_meta_info.h
+3
-3
paddle/phi/api/lib/op_meta_info.cc
paddle/phi/api/lib/op_meta_info.cc
+4
-4
未找到文件。
paddle/fluid/eager/auto_code_generator/eager_generator.cc
浏览文件 @
ee4eecef
...
...
@@ -1839,14 +1839,14 @@ static std::pair<std::string, std::string> GenerateForwardFunctionContents(
" };
\n
"
;
std
::
string
view_strategy_str
=
""
;
std
::
string
vi
we
_input_name
=
view_op_map
[
op_type
].
first
;
std
::
string
vi
we
_output_name
=
view_op_map
[
op_type
].
second
;
std
::
string
vi
ew
_input_name
=
view_op_map
[
op_type
].
first
;
std
::
string
vi
ew
_output_name
=
view_op_map
[
op_type
].
second
;
view_strategy_str
+=
paddle
::
string
::
Sprintf
(
HANDLE_VIEW_BETWEEN_INPUT_AND_OUTPUT
,
vi
we
_input_name
,
vi
we
_output_name
,
vi
we
_input_name
,
vi
we
_output_name
);
vi
ew
_input_name
,
vi
ew
_output_name
,
vi
ew
_input_name
,
vi
ew
_output_name
);
generated_function_body
+=
view_strategy_str
;
generated_function_body
+=
"
\n
"
;
...
...
paddle/fluid/eager/custom_operator/custom_operator_node.cc
浏览文件 @
ee4eecef
...
...
@@ -316,7 +316,7 @@ RunCustomOpNode::operator()(paddle::small_vector<std::vector<paddle::Tensor>,
for
(
size_t
i
=
0
;
i
<
slot_outs_num
;
i
++
)
{
const
auto
&
size_pair
=
ctx
.
OutputRangeAt
(
i
);
const
std
::
vector
<
paddle
::
Tensor
>&
out_tensors
=
ctx
.
OutputsBetwee
e
n
(
size_pair
.
first
,
size_pair
.
second
);
ctx
.
OutputsBetween
(
size_pair
.
first
,
size_pair
.
second
);
for
(
size_t
j
=
size_pair
.
first
;
j
<
size_pair
.
second
;
j
++
)
{
// SetOutRankWithSlot: slot_id = i, rank = j - size_pair.first
outs_auto_grad_metas
[
j
]
->
SetSingleOutRankWithSlot
(
i
,
...
...
@@ -332,8 +332,8 @@ RunCustomOpNode::operator()(paddle::small_vector<std::vector<paddle::Tensor>,
<<
" to grad_inputs: "
<<
it
->
second
;
grad_node
->
fwd_outs
[
it
->
second
]
=
egr
::
RunCustomOpNode
::
ConstructTensorWrapper
(
ctx
.
OutputsBetwee
e
n
(
ctx
.
OutputRangeAt
(
it
->
first
).
first
,
ctx
.
OutputRangeAt
(
it
->
first
).
second
));
ctx
.
OutputsBetween
(
ctx
.
OutputRangeAt
(
it
->
first
).
first
,
ctx
.
OutputRangeAt
(
it
->
first
).
second
));
}
// Prepare Grad inputs with fwd inputs
...
...
paddle/fluid/pybind/eager_functions.cc
浏览文件 @
ee4eecef
...
...
@@ -747,7 +747,7 @@ static PyObject* eager_api_run_custom_op(PyObject* self,
for
(
size_t
i
=
0
;
i
<
slot_outs_num
;
i
++
)
{
const
auto
&
size_pair
=
ctx
.
OutputRangeAt
(
i
);
const
std
::
vector
<
paddle
::
Tensor
>&
out_tensors
=
ctx
.
OutputsBetwee
e
n
(
size_pair
.
first
,
size_pair
.
second
);
ctx
.
OutputsBetween
(
size_pair
.
first
,
size_pair
.
second
);
for
(
size_t
j
=
size_pair
.
first
;
j
<
size_pair
.
second
;
j
++
)
{
// SetOutRankWithSlot: slot_id = i, rank = j - size_pair.first
outs_auto_grad_metas
[
j
]
->
SetSingleOutRankWithSlot
(
...
...
@@ -763,8 +763,8 @@ static PyObject* eager_api_run_custom_op(PyObject* self,
<<
" to grad_inputs: "
<<
it
->
second
;
grad_node
->
fwd_outs
[
it
->
second
]
=
egr
::
RunCustomOpNode
::
ConstructTensorWrapper
(
ctx
.
OutputsBetwee
e
n
(
ctx
.
OutputRangeAt
(
it
->
first
).
first
,
ctx
.
OutputRangeAt
(
it
->
first
).
second
));
ctx
.
OutputsBetween
(
ctx
.
OutputRangeAt
(
it
->
first
).
first
,
ctx
.
OutputRangeAt
(
it
->
first
).
second
));
}
// Prepare Grad inputs with fwd inputs
...
...
paddle/fluid/pybind/eager_legacy_op_function_generator.cc
浏览文件 @
ee4eecef
...
...
@@ -299,14 +299,14 @@ std::string GenerateOpFunctionsBody(
}
outs_initializer
+=
"}"
;
if
(
FindViewOpMap
(
op_type
))
{
std
::
string
vi
we
_input_name
=
view_op_map
[
op_type
].
first
;
std
::
string
vi
we
_output_name
=
view_op_map
[
op_type
].
second
;
std
::
string
vi
ew
_input_name
=
view_op_map
[
op_type
].
first
;
std
::
string
vi
ew
_output_name
=
view_op_map
[
op_type
].
second
;
view_strategy_str
+=
paddle
::
string
::
Sprintf
(
HANDLE_VIEW_BETWEEN_INPUT_AND_OUTPUT
,
vi
we
_input_name
,
vi
we
_output_name
,
vi
we
_input_name
,
vi
we
_output_name
);
vi
ew
_input_name
,
vi
ew
_output_name
,
vi
ew
_input_name
,
vi
ew
_output_name
);
}
if
(
!
inplace_map
.
empty
())
{
// For inplace op, Use the input PyObject directly.
...
...
paddle/phi/api/ext/op_meta_info.h
浏览文件 @
ee4eecef
...
...
@@ -133,8 +133,8 @@ class PADDLE_API CustomOpKernelContext {
return
output_range_
;
}
Tensor
*
MutableOutputAt
(
size_t
idx
);
std
::
vector
<
Tensor
*>
MutableOutputBetwee
e
n
(
size_t
start
,
size_t
end
);
std
::
vector
<
Tensor
>
OutputsBetwee
e
n
(
size_t
start
,
size_t
end
);
std
::
vector
<
Tensor
*>
MutableOutputBetween
(
size_t
start
,
size_t
end
);
std
::
vector
<
Tensor
>
OutputsBetween
(
size_t
start
,
size_t
end
);
std
::
vector
<
Tensor
>*
AllMutableOutput
();
template
<
typename
AttrType
>
...
...
@@ -391,7 +391,7 @@ struct KernelFuncImpl<Return (*)(Args...), impl_fn> {
template
<
int
in_idx
,
int
attr_idx
,
int
out_idx
,
typename
...
PreviousArgs
>
static
void
Compute
(
CustomOpKernelContext
*
ctx
,
PreviousArgs
&
...
pargs
)
{
auto
&
range
=
ctx
->
OutputRangeAt
(
out_idx
);
auto
arg
=
ctx
->
MutableOutputBetwee
e
n
(
range
.
first
,
range
.
second
);
auto
arg
=
ctx
->
MutableOutputBetween
(
range
.
first
,
range
.
second
);
ComputeCallHelper
<
Tail
...
>::
template
Compute
<
in_idx
,
attr_idx
,
out_idx
+
1
>(
ctx
,
pargs
...,
...
...
paddle/phi/api/lib/op_meta_info.cc
浏览文件 @
ee4eecef
...
...
@@ -162,8 +162,8 @@ CustomOpKernelContext::OptionalInputsBetween(size_t start, size_t end) {
Tensor
*
CustomOpKernelContext
::
MutableOutputAt
(
size_t
idx
)
{
return
&
(
outputs_
.
at
(
idx
));
}
std
::
vector
<
Tensor
*>
CustomOpKernelContext
::
MutableOutputBetwee
e
n
(
size_t
start
,
size_t
end
)
{
std
::
vector
<
Tensor
*>
CustomOpKernelContext
::
MutableOutputBetween
(
size_t
start
,
size_t
end
)
{
std
::
vector
<
Tensor
*>
rlt
;
for
(
size_t
i
=
start
;
i
<
end
;
++
i
)
{
rlt
.
emplace_back
(
&
(
outputs_
.
at
(
i
)));
...
...
@@ -171,8 +171,8 @@ std::vector<Tensor*> CustomOpKernelContext::MutableOutputBetweeen(size_t start,
return
rlt
;
}
std
::
vector
<
Tensor
>
CustomOpKernelContext
::
OutputsBetwee
e
n
(
size_t
start
,
size_t
end
)
{
std
::
vector
<
Tensor
>
CustomOpKernelContext
::
OutputsBetween
(
size_t
start
,
size_t
end
)
{
std
::
vector
<
Tensor
>
rlt
;
for
(
size_t
i
=
start
;
i
<
end
;
++
i
)
{
rlt
.
emplace_back
(
outputs_
.
at
(
i
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录