File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
paddle/fluid/inference/api Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 102
102
#include " paddle/cinn/hlir/dialect/operator/transforms/add_cinn_pass.h"
103
103
#include " paddle/cinn/hlir/dialect/operator/transforms/check_infer_symbolic_util.h"
104
104
#include " paddle/pir/include/dialect/shape/ir/shape_dialect.h"
105
+ #include " paddle/pir/include/dialect/shape/utils/shape_analysis.h"
105
106
#endif
106
107
107
108
#include " paddle/common/flags.h"
@@ -843,6 +844,11 @@ void AnalysisPredictor::OptimizeInferencePirProgram() {
843
844
std::make_unique<pir::PassManager::IRPrinterOption>(
844
845
ir_printing_conditions, ir_printing_conditions));
845
846
}
847
+ auto &shape_analysis =
848
+ pir::ShapeAnalysisManager::Instance ().Get (pir_program_.get ());
849
+ pass_manager->SetValueReplacedHook ([&](pir::Value from, pir::Value to) {
850
+ shape_analysis.ShareShapeOrData (from, to);
851
+ });
846
852
return pass_manager;
847
853
};
848
854
You can’t perform that action at this time.
0 commit comments