Skip to content

Commit

Permalink
suppot auto-gen norm (#54943)
Browse files Browse the repository at this point in the history
  • Loading branch information
heavyrain-lzy authored Jun 30, 2023
1 parent 150ca41 commit 48ef3d7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 147 deletions.
111 changes: 0 additions & 111 deletions paddle/fluid/operators/norm_op.cc

This file was deleted.

9 changes: 9 additions & 0 deletions paddle/phi/api/yaml/op_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1888,6 +1888,15 @@
outputs :
out : Out

- op : norm
backward : norm_grad
inputs :
x : X
outputs :
{out : Out, norm : Norm}
extra :
outputs : [norm]

- op : not_equal
inputs :
{x : X, y : Y}
Expand Down
10 changes: 10 additions & 0 deletions paddle/phi/api/yaml/static_backward.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,16 @@
kernel :
func : min_grad

- backward_op : norm_grad
forward : norm (Tensor x, int axis, float epsilon=1.0e-10f, bool is_test=false) -> Tensor(out), Tensor(norm)
args : (Tensor x, Tensor norm, Tensor out_grad, int axis, float epsilon, bool is_test)
output : Tensor(x_grad)
infer_meta :
func : UnchangedInferMeta
param : [x]
kernel :
func : norm_grad

- backward_op : pool2d_double_grad
forward : pool2d_grad(Tensor x, Tensor out, Tensor grad_out, IntArray kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm) -> Tensor(grad_x)
args : (Tensor grad_x_grad, IntArray kernel_size, int[] strides, int[] paddings, bool ceil_mode, bool exclusive, str data_format, str pooling_type, bool global_pooling, bool adaptive, str padding_algorithm)
Expand Down
10 changes: 10 additions & 0 deletions paddle/phi/api/yaml/static_ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,16 @@
param : [x, axis, keepdim, reduce_all]
backward : min_grad

- op : norm
args : (Tensor x, int axis, float epsilon=1.0e-10f, bool is_test=false)
output : Tensor(out), Tensor(norm)
infer_meta :
func : NormInferMeta
kernel :
func : norm
backward : norm_grad
intermediate : norm

- op : not_equal
args : (Tensor x, Tensor y, int axis = -1, bool force_cpu=false)
output : Tensor(out)
Expand Down
36 changes: 0 additions & 36 deletions paddle/phi/ops/compat/norm_sig.cc

This file was deleted.

0 comments on commit 48ef3d7

Please sign in to comment.