Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
co63oc committed May 19, 2024
1 parent f1a09ac commit d03aa9f
Show file tree
Hide file tree
Showing 18 changed files with 705 additions and 803 deletions.
458 changes: 0 additions & 458 deletions paddle/fluid/operators/cross_entropy_op.cc

This file was deleted.

48 changes: 0 additions & 48 deletions paddle/fluid/operators/cross_entropy_op.cu

This file was deleted.

297 changes: 0 additions & 297 deletions paddle/fluid/operators/cross_entropy_op.h

This file was deleted.

1 change: 1 addition & 0 deletions paddle/fluid/pir/dialect/op_generator/ops_api_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
'c_reduce_prod',
'c_reduce_prod_',
'c_scatter',
"cross_entropy_grad2",
'prune_gate_by_capacity',
'push_sparse_v2',
'push_sparse_v2_',
Expand Down
20 changes: 20 additions & 0 deletions paddle/phi/api/yaml/backward.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2880,6 +2880,26 @@
func : yolo_loss_grad
optional : gt_score

- backward_op: cross_entropy_grad
forward: cross_entropy (Tensor x, Tensor label, bool soft_label = false, int ignore_index = -100) -> Tensor (out)
args: (Tensor x, Tensor label, Tensor out_grad, bool soft_label = false, int ignore_index = -100)
output: Tensor (x_grad)
infer_meta:
func: CrossEntropyGradInferMeta
kernel:
func: cross_entropy_grad
data_type: out_grad

- backward_op: cross_entropy_grad2
forward: cross_entropy2 (Tensor x, Tensor label, int ignore_index = -100) -> Tensor (out), Tensor (x_shape), Tensor (match_x)
args: (Tensor x_shape, Tensor label, Tensor match_x, Tensor out_grad, int ignore_index = -100)
output: Tensor (x_grad)
infer_meta:
func: CrossEntropyGrad2InferMeta
kernel:
func: cross_entropy_grad2
data_type: x_shape

- backward_op: silu_double_grad
forward: silu_grad (Tensor x, Tensor out, Tensor grad_out) -> Tensor(grad_x)
args: (Tensor x, Tensor out, Tensor grad_out, Tensor grad_x_grad)
Expand Down
Loading

0 comments on commit d03aa9f

Please sign in to comment.