Skip to content

Commit

Permalink
fix squeeze unsqueeze convert bug (PaddlePaddle#63917)
Browse files Browse the repository at this point in the history
  • Loading branch information
phlrain authored and hxzd5568 committed May 8, 2024
1 parent 16527bf commit be3255b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions paddle/cinn/hlir/dialect/operator/transforms/pd_to_cinn_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,11 @@ class SqueezeOpPattern
auto axis_vec = cinn::dialect::ir::GetVectorAttr(axis_full_op, "value");
std::set<int64_t> axis_set(axis_vec.begin(), axis_vec.end());

auto in_shape = phi::vectorize(
op.operand_source(0).type().dyn_cast<phi::DenseTensor>().dims());
auto in_shape =
phi::vectorize(op.operand_source(0)
.type()
.dyn_cast<paddle::dialect::DenseTensorType>()
.dims());

std::vector<int> output_shape;

Expand Down Expand Up @@ -905,8 +908,11 @@ class UnsqueezeOpPattern
auto axis_vec = cinn::dialect::ir::GetVectorAttr(axis_full_op, "value");
std::set<int64_t> axis_set(axis_vec.begin(), axis_vec.end());

auto in_shape = phi::vectorize(
op.operand_source(0).type().dyn_cast<phi::DenseTensor>().dims());
auto in_shape =
phi::vectorize(op.operand_source(0)
.type()
.dyn_cast<paddle::dialect::DenseTensorType>()
.dims());

std::vector<int> output_shape;

Expand Down

0 comments on commit be3255b

Please sign in to comment.