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

add autogen code support for affine_grid op #52560

Merged
merged 6 commits into from
Apr 10, 2023
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
288 changes: 0 additions & 288 deletions paddle/fluid/operators/affine_grid_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 @@ -33,6 +33,17 @@
kernel :
func : addmm_grad

- backward_op : affine_grid_grad
forward : affine_grid (Tensor input, IntArray output_shape={}, bool align_corners=true) -> Tensor(output)
args : (Tensor input, Tensor output_grad, IntArray output_shape, bool align_corners=true)
output : Tensor(input_grad)
infer_meta :
func : AffineGridGradInferMeta
GreatV marked this conversation as resolved.
Show resolved Hide resolved
param : [output_grad, output_shape, align_corners]
kernel :
func : affine_grid_grad
param : [output_grad, output_shape, align_corners]

- backward_op : angle_grad
forward : angle (Tensor x) -> Tensor(out)
args : (Tensor x, Tensor out_grad)
Expand Down
12 changes: 0 additions & 12 deletions paddle/phi/api/yaml/legacy_backward.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,6 @@
func : add_triple_grad
inplace : (grad_grad_out_grad -> grad_grad_x_grad)

- backward_op : affine_grid_grad
forward : affine_grid (Tensor input, IntArray outputShape, bool align_corners=true) -> Tensor(output)
args : (Tensor input, Tensor output_grad, IntArray outputShape, bool align_corners=true)
output : Tensor(input_grad)
infer_meta :
func : AffineGridGradInferMeta
param : [output_grad, outputShape, align_corners]
kernel :
func : affine_grid_grad
param : [output_grad, outputShape, align_corners]
no_need_buffer : input

- backward_op : amax_grad
forward: amax (Tensor x, int64_t[] axis={}, bool keepdim=false) -> Tensor(out)
args : (Tensor x, Tensor out, Tensor out_grad, int64_t[] axis={}, bool keepdim=false, bool reduce_all=false)
Expand Down
12 changes: 0 additions & 12 deletions paddle/phi/api/yaml/legacy_ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,6 @@
invoke : add_n_impl(inputs)
backward : add_n_grad

- op : affine_grid
args : (Tensor input, IntArray outputShape, bool align_corners=true)
output : Tensor
infer_meta :
func : AffineGridInferMeta
param : [input, outputShape, align_corners]
kernel :
func : affine_grid
param : [input, outputShape, align_corners]
data_type : input
backward : affine_grid_grad

- op : all
args : (Tensor x, int64_t[] axis={}, bool keepdim=false)
output : Tensor(out)
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 @@ -63,6 +63,14 @@

- op : affine_grid
backward : affine_grid_grad
inputs :
input : Theta
outputs :
out : Output
int_array:
output_shape :
data_type : int
tensor_name : OutputShape
extra :
attrs : [bool use_cudnn = true]

Expand Down
8 changes: 8 additions & 0 deletions paddle/phi/api/yaml/op_version.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
- op : affine_grid
version :
- checkpoint : Compatible upgrade of affine_grid, add a new attribute [align_corners].
action :
- add_attr : align_corners
comment : Whether to align the corners of input and output.
default : "true"

- op : allclose
version :
- checkpoint : Upgrade allclose, add two new inputs [Rtol] and [Atol].
Expand Down
12 changes: 12 additions & 0 deletions paddle/phi/api/yaml/ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@
data_type : x
backward : addmm_grad

- op : affine_grid
args : (Tensor input, IntArray output_shape={}, bool align_corners=true)
output : Tensor
infer_meta :
func : AffineGridInferMeta
param : [input, output_shape, align_corners]
kernel :
func : affine_grid
param : [input, output_shape, align_corners]
data_type : input
backward : affine_grid_grad

- op : allclose
args : (Tensor x, Tensor y, Scalar rtol="1e-5", Scalar atol="1e-8", bool equal_nan=false)
output : Tensor(out)
Expand Down
Loading