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 eigvalsh #52687

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

This file was deleted.

10 changes: 10 additions & 0 deletions paddle/phi/api/yaml/backward.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,16 @@
func : eigh_grad
data_type : out_v

- backward_op : eigvalsh_grad
forward : eigvalsh (Tensor x, str uplo = "L", bool is_test = false) -> Tensor(eigenvalues), Tensor(eigenvectors)
args : (Tensor eigenvectors, Tensor eigenvalues_grad, str uplo, bool is_test)
output : Tensor(x_grad)
infer_meta :
func : EigvalshGradInferMeta
kernel :
func : eigvalsh_grad
data_type : eigenvectors

- backward_op : elu_double_grad
forward : elu_grad (Tensor x, Tensor out, Tensor grad_out, float alpha)-> Tensor(grad_x)
args : (Tensor x, Tensor grad_out, Tensor grad_x_grad, float alpha)
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 @@ -352,18 +352,6 @@
kernel :
func : dropout_grad

- backward_op : eigvalsh_grad
forward : eigvalsh (Tensor x, str uplo, bool is_test) -> Tensor(eigenvalues), Tensor(eigenvectors)
args : (Tensor eigenvectors, Tensor eigenvalues_grad, str uplo, bool is_test)
output : Tensor(x_grad)
infer_meta :
func : EigvalshGradInferMeta
kernel :
func : eigvalsh_grad
data_type : eigenvectors
data_transform :
skip_transform : eigenvalues_grad

- backward_op : einsum_grad
forward : einsum (Tensor[] x, str equation) -> Tensor(out), Tensor[](inner_cache), Tensor[](x_shape)
args : (Tensor[] x_shape, Tensor[] inner_cache, Tensor out_grad, str equation)
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 @@ -436,15 +436,6 @@
data_type: DataType::FLOAT32
optional : hypslength, refslength

- op : eigvalsh
args : (Tensor x, str uplo, bool is_test)
output : Tensor(eigenvalues), Tensor(eigenvectors)
infer_meta :
func : EigvalshInferMeta
kernel :
func : eigvalsh
backward : eigvalsh_grad

- op : einsum
args : (Tensor[] x, str equation)
output : Tensor, Tensor[]{x.size()}, Tensor[]{x.size()}
Expand Down
9 changes: 9 additions & 0 deletions paddle/phi/api/yaml/op_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,15 @@
outputs :
out : Out

- op : eigvalsh
backward : eigvalsh_grad
inputs :
{x : X}
outputs :
{eigenvalues : Eigenvalues, eigenvectors : Eigenvectors}
attrs :
uplo : UPLO

- op : elementwise_pow
backward : elementwise_pow_grad
extra :
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 @@ -474,6 +474,16 @@
kernel :
func : eigvals

- op : eigvalsh
args : (Tensor x, str uplo = "L", bool is_test = false)
output : Tensor(eigenvalues), Tensor(eigenvectors)
infer_meta :
func : EigvalshInferMeta
kernel :
func : eigvalsh
data_type : x
backward : eigvalsh_grad

- op : elu
args : (Tensor x, float alpha = 1.0f)
output : Tensor(out)
Expand Down
4 changes: 3 additions & 1 deletion paddle/phi/kernels/cpu/eigvalsh_grad_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ PD_REGISTER_KERNEL(eigvalsh_grad,
float,
double,
phi::dtype::complex<float>,
phi::dtype::complex<double>) {}
phi::dtype::complex<double>) {
kernel->InputAt(1).SetDataType(phi::dtype::ToReal(kernel_key.dtype()));
}
4 changes: 3 additions & 1 deletion paddle/phi/kernels/gpu/eigvalsh_grad_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ PD_REGISTER_KERNEL(eigvalsh_grad,
float,
double,
phi::dtype::complex<float>,
phi::dtype::complex<double>) {}
phi::dtype::complex<double>) {
kernel->InputAt(1).SetDataType(phi::dtype::ToReal(kernel_key.dtype()));
}
4 changes: 3 additions & 1 deletion paddle/phi/kernels/gpu/eigvalsh_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ PD_REGISTER_KERNEL(eigvalsh, // cuda_only
float,
double,
phi::dtype::complex<float>,
phi::dtype::complex<double>) {}
phi::dtype::complex<double>) {
kernel->InputAt(1).SetDataType(phi::dtype::ToReal(kernel_key.dtype()));
}
34 changes: 0 additions & 34 deletions paddle/phi/ops/compat/eigvalsh_sig.cc

This file was deleted.