Skip to content

Commit

Permalink
fix bug of fuse shape ops to generate_shape (#62587)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyfncg committed Mar 11, 2024
1 parent 04f5f59 commit cf96b67
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "paddle/fluid/pir/dialect/operator/ir/op_attribute.h"
#include "paddle/fluid/pir/dialect/operator/ir/op_type.h"
#include "paddle/fluid/pir/dialect/operator/ir/pd_op.h"
#include "paddle/fluid/pir/transforms/transform_general_functions.h"
#include "paddle/pir/include/core/builtin_dialect.h"
#include "paddle/pir/include/dialect/shape/utils/dim_expr.h"
#include "paddle/pir/include/dialect/shape/utils/shape_analysis.h"
Expand Down Expand Up @@ -57,8 +58,8 @@ std::vector<pir::Value> FindSourceDenseTensorOfDimTensor(
// find input dimension tensor;
pir::Operation* owner = value.defining_op();
if (owner == nullptr) return;
for (int i = 0; i < owner->num_operands(); ++i) {
Visit(owner->operand_source(i));
for (auto input_value : pir::GetUsedExternalValue(*owner)) {
Visit(input_value);
}
};
const auto& IsDimTensorOrListDimExpr = symbol::Overloaded{
Expand Down

0 comments on commit cf96b67

Please sign in to comment.