未验证 提交 63b6a11b 编写于 作者: Z zyfncg 提交者: GitHub

Clear extra attrs of reduce op in OpMaker (#45786)

* clear extra attrs of reduce op in opmaker

* fix reduce_mean
上级 91631492
...@@ -79,6 +79,7 @@ class ReduceMeanDoubleGradOpBaseMaker : public imperative::GradOpBaseMakerBase { ...@@ -79,6 +79,7 @@ class ReduceMeanDoubleGradOpBaseMaker : public imperative::GradOpBaseMakerBase {
op.SetType("reduce_mean"); op.SetType("reduce_mean");
op.SetInput("X", x_gg); op.SetInput("X", x_gg);
op.SetAttrMap(Attrs()); op.SetAttrMap(Attrs());
op.SetDefaultAttrsMap(DefaultAttrsMap());
op.SetOutput("Out", out_grads); op.SetOutput("Out", out_grads);
} }
return node; return node;
......
...@@ -718,10 +718,6 @@ class ReduceOpMaker : public framework::OpProtoAndCheckerMaker { ...@@ -718,10 +718,6 @@ class ReduceOpMaker : public framework::OpProtoAndCheckerMaker {
"(int, default -1)" "(int, default -1)"
"The dtype of output, default value is -1, the dtype is same as intput") "The dtype of output, default value is -1, the dtype is same as intput")
.SetDefault(-1); .SetDefault(-1);
AddAttr<bool>("use_mkldnn",
"(bool, default false) Only used in mkldnn kernel")
.SetDefault(false)
.AsExtra();
AddComment(string::Sprintf(R"DOC( AddComment(string::Sprintf(R"DOC(
%s Operator. %s Operator.
......
...@@ -203,6 +203,11 @@ ...@@ -203,6 +203,11 @@
inputs: {x: X} inputs: {x: X}
outputs: {out: Out} outputs: {out: Out}
- api : frobenius_norm
backward : frobenius_norm_grad
extra :
attrs : [bool use_mkldnn = false]
- api : gelu - api : gelu
backward : gelu_grad backward : gelu_grad
extra : extra :
...@@ -288,6 +293,49 @@ ...@@ -288,6 +293,49 @@
outputs : outputs :
out : Out 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 - api : renorm
backward : renorm_grad backward : renorm_grad
extra : extra :
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册