Skip to content

Commit 8408576

Browse files
committed
rm unused func
1 parent 2c68b8f commit 8408576

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/binary_infer_sym.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,16 +1361,14 @@ bool MatrixRankTolOpInferSymbolicShape(
13611361
common::errors::InvalidArgument(
13621362
"The dims of input must be greater than 2"));
13631363
bool hermitian = GetBoolAttr(op, "hermitian");
1364-
const auto &GetProduct = [&](const auto &dim_exprs, const auto &Filter) {
1364+
const auto &GetProduct = [&](const auto &dim_exprs) {
13651365
symbol::DimExpr product{1};
13661366
for (const auto &dim_expr : dim_exprs) {
1367-
if (Filter(dim_expr)) {
1368-
product = product * dim_expr;
1369-
}
1367+
product = product * dim_expr;
13701368
}
13711369
return product;
13721370
};
1373-
const auto &x_numel = GetProduct(x_shape, [](const auto &) { return true; });
1371+
const auto &x_numel = GetProduct(x_shape);
13741372

13751373
if (hermitian && x_numel != 0) {
13761374
infer_context->AddEqualCstr(x_shape[x_rank - 2], x_shape[x_rank - 1]);

paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,16 +2168,14 @@ bool MatrixRankOpInferSymbolicShape(
21682168
infer_context->GetShapeOrDataForValue(op->operand_source(0));
21692169
const std::vector<symbol::DimExpr> &x_shape = x_shape_or_data.shape();
21702170

2171-
const auto &GetProduct = [&](const auto &dim_exprs, const auto &Filter) {
2171+
const auto &GetProduct = [&](const auto &dim_exprs) {
21722172
symbol::DimExpr product{1};
21732173
for (const auto &dim_expr : dim_exprs) {
2174-
if (Filter(dim_expr)) {
2175-
product = product * dim_expr;
2176-
}
2174+
product = product * dim_expr;
21772175
}
21782176
return product;
21792177
};
2180-
const auto &x_numel = GetProduct(x_shape, [](const auto &) { return true; });
2178+
const auto &x_numel = GetProduct(x_shape);
21812179

21822180
// 确保输入x的维度大于等于2
21832181
PADDLE_ENFORCE_GE(x_shape.size(),

0 commit comments

Comments
 (0)