Skip to content

Commit

Permalink
add autogen code support for accuracy (#52424)
Browse files Browse the repository at this point in the history
* add autogen code support for accuracy

* fix input
  • Loading branch information
gouzil authored Apr 3, 2023
1 parent 2f85099 commit 1f3b9ef
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 86 deletions.
77 changes: 0 additions & 77 deletions paddle/fluid/operators/metrics/accuracy_op.cc

This file was deleted.

9 changes: 0 additions & 9 deletions paddle/phi/api/yaml/legacy_ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@
func : abs
backward : abs_grad

- op : accuracy
args : (Tensor x, Tensor indices, Tensor label)
output : Tensor(accuracy), Tensor(correct), Tensor(total)
infer_meta :
func : AccuracyInferMeta
kernel :
func : accuracy
data_type : x

- op : adadelta_
args : (Tensor param, Tensor grad, Tensor avg_squared_grad, Tensor avg_squared_update, Tensor master_param, float rho, float epsilon, bool multi_precision)
output : Tensor(param_out), Tensor(moment_out), Tensor(inf_norm_out), Tensor(master_param_out)
Expand Down
6 changes: 6 additions & 0 deletions paddle/phi/api/yaml/op_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
extra :
attrs : [bool use_mkldnn = false]

- op : accuracy
inputs :
{x : Out , indices : Indices, label: Label}
outputs :
{accuracy : Accuracy, correct : Correct, total : Total}

- op : acos
inputs :
x : X
Expand Down
9 changes: 9 additions & 0 deletions paddle/phi/api/yaml/ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
# are consistent and correspond one-to-one. It's forbidden that the
# operator configured in this yaml file does not have Python API.

- op : accuracy
args : (Tensor x, Tensor indices, Tensor label)
output : Tensor(accuracy), Tensor(correct), Tensor(total)
infer_meta :
func : AccuracyInferMeta
kernel :
func : accuracy
data_type : x

- op : acos
args : (Tensor x)
output : Tensor
Expand Down

0 comments on commit 1f3b9ef

Please sign in to comment.