Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
4e5ae23e
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
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看板
未验证
提交
4e5ae23e
编写于
8月 15, 2023
作者:
H
hong
提交者:
GitHub
8月 15, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix op translator reshape type (#56294)
上级
bcc5ce44
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
4 addition
and
5 deletion
+4
-5
paddle/fluid/ir_adaptor/translator/op_translator.cc
paddle/fluid/ir_adaptor/translator/op_translator.cc
+4
-5
未找到文件。
paddle/fluid/ir_adaptor/translator/op_translator.cc
浏览文件 @
4e5ae23e
...
@@ -1355,8 +1355,8 @@ struct ElementwiseTranscriber : public OpTranscriber {
...
@@ -1355,8 +1355,8 @@ struct ElementwiseTranscriber : public OpTranscriber {
for
(
int
i
=
0
;
i
<=
append_size
;
i
++
)
{
for
(
int
i
=
0
;
i
<=
append_size
;
i
++
)
{
y_new_shape
.
push_back
(
1
);
y_new_shape
.
push_back
(
1
);
}
}
dialect
::
Reshape
_
Op
reshape_op
=
dialect
::
ReshapeOp
reshape_op
=
builder
.
Build
<
dialect
::
Reshape
_
Op
>
(
y_value
,
y_new_shape
);
builder
.
Build
<
dialect
::
ReshapeOp
>
(
y_value
,
y_new_shape
);
y_new
=
reshape_op
.
out
();
y_new
=
reshape_op
.
out
();
VLOG
(
6
)
<<
"["
<<
op_desc
.
Type
()
<<
"] y_shape change from "
VLOG
(
6
)
<<
"["
<<
op_desc
.
Type
()
<<
"] y_shape change from "
<<
y_tensor_type
.
dims
()
<<
" to "
<<
phi
::
make_ddim
(
y_new_shape
);
<<
y_tensor_type
.
dims
()
<<
" to "
<<
phi
::
make_ddim
(
y_new_shape
);
...
@@ -1371,8 +1371,7 @@ struct ElementwiseTranscriber : public OpTranscriber {
...
@@ -1371,8 +1371,7 @@ struct ElementwiseTranscriber : public OpTranscriber {
auto
concat_op
=
auto
concat_op
=
builder
.
Build
<
dialect
::
ConcatOp
>
(
y_true_shape_op
.
out
(),
0
);
builder
.
Build
<
dialect
::
ConcatOp
>
(
y_true_shape_op
.
out
(),
0
);
auto
y_new_shape
=
concat_op
.
out
();
auto
y_new_shape
=
concat_op
.
out
();
auto
reshape_op
=
auto
reshape_op
=
builder
.
Build
<
dialect
::
ReshapeOp
>
(
y_value
,
y_new_shape
);
builder
.
Build
<
dialect
::
Reshape_Op
>
(
y_value
,
y_new_shape
);
y_new
=
reshape_op
.
out
();
y_new
=
reshape_op
.
out
();
}
}
return
{
x_value
,
y_new
};
return
{
x_value
,
y_new
};
...
@@ -1449,7 +1448,7 @@ struct ElementwiseGradTranscriber : public OpTranscriber {
...
@@ -1449,7 +1448,7 @@ struct ElementwiseGradTranscriber : public OpTranscriber {
ir
::
OpResult
value
=
operation
->
result
(
idx
);
ir
::
OpResult
value
=
operation
->
result
(
idx
);
ir
::
Builder
builder
(
ctx
,
operation
->
GetParent
());
ir
::
Builder
builder
(
ctx
,
operation
->
GetParent
());
auto
reshape_op
=
builder
.
Build
<
dialect
::
Reshape
_
Op
>
(
value
,
y_shape
);
auto
reshape_op
=
builder
.
Build
<
dialect
::
ReshapeOp
>
(
value
,
y_shape
);
(
*
param_map
)[
y_grad_var_name
]
=
(
*
param_map
)[
y_grad_var_name
]
=
VariableDefiningInfo
(
reshape_op
.
out
(),
false
,
-
1
);
VariableDefiningInfo
(
reshape_op
.
out
(),
false
,
-
1
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录