Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear extra attrs of reduce op in OpMaker #45786

Merged
merged 2 commits into from
Sep 7, 2022
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
1 change: 1 addition & 0 deletions paddle/fluid/operators/reduce_ops/reduce_mean_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class ReduceMeanDoubleGradOpBaseMaker : public imperative::GradOpBaseMakerBase {
op.SetType("reduce_mean");
op.SetInput("X", x_gg);
op.SetAttrMap(Attrs());
op.SetDefaultAttrsMap(DefaultAttrsMap());
op.SetOutput("Out", out_grads);
}
return node;
Expand Down
4 changes: 0 additions & 4 deletions paddle/fluid/operators/reduce_ops/reduce_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -718,10 +718,6 @@ class ReduceOpMaker : public framework::OpProtoAndCheckerMaker {
"(int, default -1)"
"The dtype of output, default value is -1, the dtype is same as intput")
.SetDefault(-1);
AddAttr<bool>("use_mkldnn",
"(bool, default false) Only used in mkldnn kernel")
.SetDefault(false)
.AsExtra();
AddComment(string::Sprintf(R"DOC(
%s Operator.
Expand Down
48 changes: 48 additions & 0 deletions paddle/phi/api/yaml/api_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@
inputs: {x: X}
outputs: {out: Out}

- api : frobenius_norm
backward : frobenius_norm_grad
extra :
attrs : [bool use_mkldnn = false]

- api : gelu
backward : gelu_grad
extra :
Expand Down Expand Up @@ -288,6 +293,49 @@
outputs :
out : Out

- api : reduce_all
extra :
attrs : [bool use_mkldnn = false]

- api : reduce_amax
backward : reduce_amax_grad
extra :
attrs : [bool use_mkldnn = false]

- api : reduce_amin
backward : reduce_amin_grad
extra :
attrs : [bool use_mkldnn = false]

- api : reduce_any
extra :
attrs : [bool use_mkldnn = false]

- api : reduce_max
backward : reduce_max_grad
extra :
attrs : [bool use_mkldnn = false]

- api : reduce_mean
backward : reduce_mean_grad
extra :
attrs : [bool use_mkldnn = false]

- api : reduce_min
backward : reduce_min_grad
extra :
attrs : [bool use_mkldnn = false]

- api : reduce_prod
backward : reduce_prod_grad
extra :
attrs : [bool use_mkldnn = false]

- api : reduce_sum
backward : reduce_sum_grad
extra :
attrs : [bool use_mkldnn = false]

- api : renorm
backward : renorm_grad
extra :
Expand Down