Skip to content

Commit

Permalink
Support static graph code-gen for unpool3d (#53479)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanbuphy authored May 9, 2023
1 parent ea0abf9 commit dd90f10
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 237 deletions.
179 changes: 0 additions & 179 deletions paddle/fluid/operators/unpool_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 @@ -2065,6 +2065,17 @@
func : where_grad
no_need_buffer : x, y

- backward_op: unpool3d_grad
forward: unpool3d (Tensor x, Tensor indices, int[] ksize, int[] strides={1,1,1}, int[] paddings={0,0,0}, int[] output_size={0,0,0}, str data_format="NCDHW") -> Tensor(out)
args: (Tensor x, Tensor indices, Tensor out, Tensor out_grad, int[] ksize, int[] strides, int[] paddings, int[] output_size, str data_format)
output: Tensor(x_grad)
infer_meta:
func: UnchangedInferMeta
param : [x]
kernel:
func: unpool3d_grad
data_type: x

- backward_op: unpool_grad
forward: unpool (Tensor x, Tensor indices, int[] ksize, int[] strides = {1,1}, int[] paddings ={0,0} ,IntArray output_size = {0,0}, str data_format="NCHW") -> Tensor(out)
args: (Tensor x, Tensor indices, Tensor out, Tensor out_grad, int[] ksize, int[] strides, int[] paddings, IntArray output_size, str data_format)
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 @@ -1042,14 +1042,3 @@
kernel :
func : yolo_loss_grad
optional : gt_score

- backward_op: unpool3d_grad
forward: unpool3d (Tensor x, Tensor indices, int[] ksize, int[] strides, int[] padding, int[] output_size, str data_format) -> Tensor(out)
args: (Tensor x, Tensor indices, Tensor out, Tensor out_grad, int[] ksize, int[] strides, int[] padding, int[] output_size, str data_format)
output: Tensor(x_grad)
infer_meta:
func: UnchangedInferMeta
param : [x]
kernel:
func: unpool3d_grad
data_type: x
10 changes: 0 additions & 10 deletions paddle/phi/api/yaml/legacy_ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1207,16 +1207,6 @@
func : unique
data_type : x

- op : unpool3d
args: (Tensor x, Tensor indices, int[] ksize, int[] strides, int[] padding, int[] output_size, str data_format)
output: Tensor(out)
infer_meta:
func: Unpool3dInferMeta
kernel:
func: unpool3d
data_type: x
backward: unpool3d_grad

- op : yolo_loss
args : (Tensor x, Tensor gt_box, Tensor gt_label, Tensor gt_score, int[] anchors, int[] anchor_mask, int class_num, float ignore_thresh, int downsample_ratio, bool use_label_smooth=true, float scale_x_y=1.0)
output : Tensor(loss), Tensor(objectness_mask), Tensor(gt_match_mask)
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 @@ -2431,6 +2431,12 @@
data_type : int
support_tensor : true

- op : unpool3d
inputs :
{x : X, indices: Indices}
outputs :
out : Out

- op : unsqueeze (unsqueeze2)
backward : unsqueeze_grad (unsqueeze2_grad), unsqueeze_double_grad(unsqueeze2_double_grad)
inputs :
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 @@ -2153,6 +2153,16 @@
data_type: x
backward: unpool_grad

- op : unpool3d
args: (Tensor x, Tensor indices, int[] ksize, int[] strides={1,1,1}, int[] paddings={0,0,0}, int[] output_size={0,0,0}, str data_format="NCDHW")
output: Tensor(out)
infer_meta:
func: Unpool3dInferMeta
kernel:
func: unpool3d
data_type: x
backward: unpool3d_grad

- op : unsqueeze
args : (Tensor x, IntArray axis = {})
output : Tensor(out), Tensor(xshape)
Expand Down
37 changes: 0 additions & 37 deletions paddle/phi/ops/compat/unpool3d_sig.cc

This file was deleted.

0 comments on commit dd90f10

Please sign in to comment.