Skip to content

Commit

Permalink
clear extra attrs of condition op in opmaker (PaddlePaddle#46150)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyfncg committed Sep 27, 2022
1 parent e05c1eb commit fe44e60
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
5 changes: 0 additions & 5 deletions paddle/fluid/operators/controlflow/conditional_block_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,6 @@ class ConditionalBlockOpProtoMaker : public framework::OpProtoAndCheckerMaker {
"The conditional variable (Cond) is used as scalar "
"condition.")
.SetDefault(false);
AddAttr<std::vector<std::string>>(ConditionalOp::kSkipEagerDeletionVars,
"Vars that would not be deleted when "
"garbage collection strategy enables")
.SetDefault(std::vector<std::string>())
.AsExtra();
AddComment(R"DOC(Conditional block operator
If `is_scalar_condition` is True, the conditional variable (Cond) is a scalar,
Expand Down
5 changes: 0 additions & 5 deletions paddle/fluid/operators/controlflow/while_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,6 @@ class WhileOpMaker : public framework::OpProtoAndCheckerMaker {
"(bool, default false) Set to true for inference only, false "
"for training. Some layers may run faster when this is true.")
.SetDefault(false);
AddAttr<std::vector<std::string>>(kSkipEagerDeletionVars,
"Vars that would skip eager deletion."
"Users should not set this manually.")
.SetDefault(std::vector<std::string>())
.AsExtra();
AddComment(R"DOC(
)DOC");
}
Expand Down
15 changes: 10 additions & 5 deletions paddle/phi/api/yaml/op_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@
extra :
attrs : [bool use_mkldnn = false, bool use_quantizer = false, str mkldnn_data_type = "float32"]

- op : conditional_block
backward : conditional_block_grad
extra :
attrs : ['str[] skip_eager_deletion_vars = {}']

- op : conv2d
backward : conv2d_grad
extra :
Expand Down Expand Up @@ -504,11 +509,6 @@
extra :
attrs : [bool use_mkldnn = false]

- op : pool3d
backward : pool3d_grad
extra :
attrs : [bool use_mkldnn = false]

- op : prelu
backward : prelu_grad
extra :
Expand Down Expand Up @@ -750,3 +750,8 @@
x : X
outputs :
out : Out

- op : while
backward : while_grad
extra :
attrs : ['str[] skip_eager_deletion_vars = {}']

0 comments on commit fe44e60

Please sign in to comment.