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

support auto generate for bce_loss #52231

Merged
Merged
Show file tree
Hide file tree
Changes from 4 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
158 changes: 0 additions & 158 deletions paddle/fluid/operators/bce_loss_op.cc

This file was deleted.

11 changes: 11 additions & 0 deletions paddle/phi/api/yaml/backward.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,17 @@
func : atanh_grad
inplace : (out_grad -> x_grad)

- backward_op : bce_loss_grad
forward : bce_loss (Tensor input, Tensor label) -> Tensor(out)
args : (Tensor input, Tensor label, Tensor out_grad)
output : Tensor(input_grad)
infer_meta :
func : UnchangedInferMeta
param : [input]
kernel :
func : bce_loss_grad
inplace : (out_grad -> input_grad)

- backward_op : bicubic_interp_grad
forward : bicubic_interp (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, str data_layout="NCHW", int out_d=0, int out_h=0, int out_w=0, float[] scale={}, str interp_method="bilinear", bool align_corners=true, int align_mode=1) -> Tensor(output)
args : (Tensor x, Tensor out_size, Tensor[] size_tensor, Tensor scale_tensor, Tensor output_grad, str data_layout, int out_d, int out_h, int out_w, float[] scale, str interp_method, bool align_corners, int align_mode)
Expand Down
11 changes: 0 additions & 11 deletions paddle/phi/api/yaml/legacy_backward.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,6 @@
composite: batch_norm_grad(x, scale, bias, mean_out, variance_out, saved_mean, saved_variance, reserve_space, out_grad, momentum, epsilon, data_layout, is_test, use_global_stats, trainable_statistics)
backward : batch_norm_double_grad

- backward_op : bce_loss_grad
forward : bce_loss (Tensor input, Tensor label) -> Tensor(out)
args : (Tensor input, Tensor label, Tensor out_grad)
output : Tensor(input_grad)
infer_meta :
func : UnchangedInferMeta
param : [input]
kernel :
func : bce_loss_grad
inplace : (out_grad -> input_grad)

- backward_op : bilinear_tensor_product_grad
forward : bilinear_tensor_product (Tensor x, Tensor y, Tensor weight, Tensor bias) -> Tensor(out)
args : (Tensor x, Tensor y, Tensor weight, Tensor out_grad)
Expand Down
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 @@ -232,15 +232,6 @@
view : (mean -> mean_out), (variance -> variance_out)
backward : batch_norm_grad

- op : bce_loss
args : (Tensor input, Tensor label)
output : Tensor
infer_meta :
func : BCELossInferMeta
kernel :
func : bce_loss
backward : bce_loss_grad

- op : bilinear_tensor_product
args : (Tensor x, Tensor y, Tensor weight, Tensor bias)
output : Tensor
Expand Down
8 changes: 8 additions & 0 deletions paddle/phi/api/yaml/op_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,14 @@
extra :
attrs : [bool use_mkldnn = false, bool fuse_with_relu = false]

- op : bce_loss
backward : bce_loss_grad
inputs :
{input : X, label : Label}
outputs :
out : Out
inplace : (x -> out)

- op : bernoulli
inputs :
x : X
Expand Down
10 changes: 10 additions & 0 deletions paddle/phi/api/yaml/ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@
func : atanh
backward : atanh_grad

- op : bce_loss
args : (Tensor input, Tensor label)
output : Tensor
infer_meta :
func : BCELossInferMeta
kernel :
func : bce_loss
data_type : x
backward : bce_loss_grad

- op : bernoulli
args : (Tensor x)
output : Tensor(out)
Expand Down
27 changes: 0 additions & 27 deletions paddle/phi/ops/compat/bce_loss_sig.cc

This file was deleted.