Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/cinn_op_infer_sym.h"
#include "paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/infer_sym_slice_utils.h"
#include "paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/infer_sym_utils.h"
#include "paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc"

namespace cinn::dialect {

Expand Down Expand Up @@ -222,18 +221,6 @@ bool SplitOpInferSymbolicShape(pir::Operation *op,
return true;
}

bool Pool2dOpInferSymbolicShape(pir::Operation *op,
pir::InferSymbolicShapeContext *infer_context) {
const auto &kernel_size_shape_or_data =
infer_context->GetShapeOrDataForValue(op->operand_source(1));
const auto &kernel_size =
paddle::dialect::details::GetExprVecFromData(kernel_size_shape_or_data);
infer_context->SetShapeOrDataForValue(
op->result(0),
Pool2dRawInferSymbolicShape(op, kernel_size, infer_context));
return true;
}

bool ReduceInferSymbolicShape(pir::Operation *op,
pir::InferSymbolicShapeContext *infer_context) {
bool keepdim = GetBoolAttr(op, "keepdim");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
namespace cinn::dialect {
OP_DECLARE_INFER_SYMBOLIC_SHAPE(Broadcast)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(Concat)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(Pool2d)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(ReduceMax)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(ReduceMin)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(ReduceProd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ std::vector<symbol::DimExpr> GetRealPadding(
const std::vector<int> &origin_paddings,
const bool global_pooling,
const bool adaptive,
const std::string padding_algorithm,
const std::vector<symbol::DimExpr> data_dims,
const std::string &padding_algorithm,
const std::vector<symbol::DimExpr> &data_dims,
const std::vector<int> &strides,
const std::vector<symbol::DimExpr> &kernel_size) {
const auto &GetInitPadding = [&]() -> std::vector<symbol::DimExpr> {
Expand Down Expand Up @@ -51,7 +51,7 @@ std::vector<symbol::DimExpr> GetRealPadding(

std::vector<symbol::DimExpr> real_padding = GetInitPadding();

const auto &UpdataPadding = [&]() {
const auto &UpdatePadding = [&]() {
symbol::DimExpr one_dimexpr{1};
symbol::DimExpr zero_dimexpr{0};
// when padding_algorithm is "VALID" or "SAME"
Expand Down Expand Up @@ -81,7 +81,7 @@ std::vector<symbol::DimExpr> GetRealPadding(
}
};

UpdataPadding();
UpdatePadding();
return real_padding;
}

Expand Down
Loading