Skip to content

Commit 6543b76

Browse files
pir print support grad (#70969)
1 parent 2c7e605 commit 6543b76

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

paddle/phi/ops/yaml/inconsistent/static_backward.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,12 @@
476476
data_type: input
477477
optional: bias, sample_weight, custom_dist_probs, custom_dist_alias, custom_dist_alias_probs
478478

479+
- backward_op : print_grad
480+
forward : print (Tensor in, int first_n, str message, int summarize, bool print_tensor_name = true, bool print_tensor_type = true, bool print_tensor_shape = true, bool print_tensor_layout = true, bool print_tensor_lod = true, str print_phase = "BOTH", bool is_forward = true) -> Tensor(out)
481+
args : (Tensor out_grad, int first_n, str message, int summarize, bool print_tensor_name = true, bool print_tensor_type = true, bool print_tensor_shape = true, bool print_tensor_layout = true, bool print_tensor_lod = true, str print_phase = "BOTH", bool is_forward = true)
482+
output : Tensor(in_grad)
483+
invoke : print(out_grad, first_n, message, summarize, print_tensor_name, print_tensor_type, print_tensor_shape, print_tensor_layout, print_tensor_lod, print_phase, is_forward)
484+
479485
- backward_op : push_box_sparse
480486
forward : pull_box_sparse (Tensor w, Tensor[] ids, bool is_sparse = false, bool is_distributed = false, int size = 1) -> Tensor[](out){ids.size()}
481487
args : (Tensor[] ids, Tensor[] out_grad_in, bool is_sparse = false, bool is_distributed = false, int size = 1)

paddle/phi/ops/yaml/inconsistent/static_ops.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,8 @@
627627
func : print_kernel
628628
param: [in, first_n, message, summarize, print_tensor_name, print_tensor_type, print_tensor_shape, print_tensor_layout, print_tensor_lod, print_phase, is_forward]
629629
interfaces : paddle::dialect::InferSymbolicShapeInterface
630-
traits : pir::SideEffectTrait, paddle::dialect::ForwardOnlyTrait
630+
traits : pir::SideEffectTrait
631+
backward: print_grad
631632

632633
- op : pull_box_sparse
633634
args : (Tensor w, Tensor[] ids, bool is_sparse = false, bool is_distributed = false, int size = 1)

0 commit comments

Comments
 (0)