From 4e5ae23ea4b074bd61e49fa3653bc32a4dd52d25 Mon Sep 17 00:00:00 2001 From: hong <43953930+phlrain@users.noreply.github.com> Date: Tue, 15 Aug 2023 22:04:44 +0800 Subject: [PATCH] fix op translator reshape type (#56294) --- paddle/fluid/ir_adaptor/translator/op_translator.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/paddle/fluid/ir_adaptor/translator/op_translator.cc b/paddle/fluid/ir_adaptor/translator/op_translator.cc index ef53f1d496a..dcd9bddb061 100644 --- a/paddle/fluid/ir_adaptor/translator/op_translator.cc +++ b/paddle/fluid/ir_adaptor/translator/op_translator.cc @@ -1355,8 +1355,8 @@ struct ElementwiseTranscriber : public OpTranscriber { for (int i = 0; i <= append_size; i++) { y_new_shape.push_back(1); } - dialect::Reshape_Op reshape_op = - builder.Build(y_value, y_new_shape); + dialect::ReshapeOp reshape_op = + builder.Build(y_value, y_new_shape); y_new = reshape_op.out(); VLOG(6) << "[" << op_desc.Type() << "] y_shape change from " << y_tensor_type.dims() << " to " << phi::make_ddim(y_new_shape); @@ -1371,8 +1371,7 @@ struct ElementwiseTranscriber : public OpTranscriber { auto concat_op = builder.Build(y_true_shape_op.out(), 0); auto y_new_shape = concat_op.out(); - auto reshape_op = - builder.Build(y_value, y_new_shape); + auto reshape_op = builder.Build(y_value, y_new_shape); y_new = reshape_op.out(); } return {x_value, y_new}; @@ -1449,7 +1448,7 @@ struct ElementwiseGradTranscriber : public OpTranscriber { ir::OpResult value = operation->result(idx); ir::Builder builder(ctx, operation->GetParent()); - auto reshape_op = builder.Build(value, y_shape); + auto reshape_op = builder.Build(value, y_shape); (*param_map)[y_grad_var_name] = VariableDefiningInfo(reshape_op.out(), false, -1); } -- GitLab