File tree 1 file changed +5
-0
lines changed
paddle/fluid/pir/transforms/general
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 15
15
#include " paddle/fluid/pir/transforms/general/replace_fetch_with_shadow_output_pass.h"
16
16
17
17
#include " paddle/fluid/pir/dialect/operator/ir/pd_op.h"
18
+ #include " paddle/fluid/pir/utils/general_functions.h"
18
19
#include " paddle/pir/include/core/builtin_op.h"
19
20
#include " paddle/pir/include/pass/pass.h"
20
21
#include " paddle/pir/include/pass/pass_registry.h"
@@ -28,6 +29,10 @@ class ReplaceFetchWithShadowOutputPattern
28
29
bool MatchAndRewrite (
29
30
paddle::dialect::FetchOp op,
30
31
pir::PatternRewriter& rewriter) const override { // NOLINT
32
+ if (pir::GetDefiningOpForInput (op, 0 )->HasAttribute (" name" )) {
33
+ // DataOp/FeedOp
34
+ return false ;
35
+ }
31
36
rewriter.Build <pir::ShadowOutputOp>(
32
37
op->operand_source (0 ),
33
38
op->attributes ().at (" name" ).dyn_cast <pir::StrAttribute>().AsString ());
You can’t perform that action at this time.
0 commit comments