diff --git a/paddle/phi/api/yaml/op_compat.yaml b/paddle/phi/api/yaml/op_compat.yaml index 8734750400ac6bb807201e888795a296239ff4ab..d893484a9f577bf725bbb4a0574109dd3c5576ee 100644 --- a/paddle/phi/api/yaml/op_compat.yaml +++ b/paddle/phi/api/yaml/op_compat.yaml @@ -1138,8 +1138,14 @@ extra : attrs : [bool use_mkldnn = false] -- op : reduce_mean +- op : mean (reduce_mean) backward : reduce_mean_grad + inputs : + x : X + outputs : + out : Out + attrs : + {axis : dim, keepdim : keep_dim} extra : attrs : [bool use_mkldnn = false] diff --git a/python/paddle/incubate/autograd/utils.py b/python/paddle/incubate/autograd/utils.py index 211851160b17fd6c148428c2983624fba3062e5f..70537a3c8b55967fc7a1f93d7cef55aacf2d9027 100644 --- a/python/paddle/incubate/autograd/utils.py +++ b/python/paddle/incubate/autograd/utils.py @@ -183,7 +183,8 @@ def _get_args_values(op, phi_name): and arg_name in op_content["attrs"].keys() ): attrs.append(op.attr(op_content["attrs"][arg_name])) - attrs.append(op.attr(arg_name)) + else: + attrs.append(op.attr(arg_name)) return inputs, attrs