Skip to content

Commit

Permalink
rm solve_op.cc / solve_sig.cc and migrate yaml config
Browse files Browse the repository at this point in the history
  • Loading branch information
veyron95 committed Jul 18, 2022
1 parent fa3f08b commit f71d642
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 170 deletions.
124 changes: 0 additions & 124 deletions paddle/fluid/operators/solve_op.cc

This file was deleted.

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

- api : solve
args : (Tensor x, Tensor y)
output : Tensor
infer_meta :
func : SolveInferMeta
kernel :
func : solve
data_type : x
backward : solve_grad

- api : trace
args : (Tensor x, int offset = 0, int axis1 = 0, int axis2 = 1)
output : Tensor
Expand Down
6 changes: 6 additions & 0 deletions paddle/phi/api/yaml/api_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@
outputs :
out : Out

- api : solve
inputs :
{x : X, y : Y}
outputs :
out : Out

- api : trace
inputs :
x : Input
Expand Down
10 changes: 10 additions & 0 deletions paddle/phi/api/yaml/backward.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@
kernel :
func : poisson_grad

- backward_api : solve_grad
forward : solve (Tensor x, Tensor y) -> Tensor(out)
args : (Tensor x, Tensor y, Tensor out, Tensor out_grad)
output : Tensor(x_grad), Tensor(y_grad)
infer_meta :
func : GeneralBinaryGradInferMeta
param : [x, y]
kernel :
func : solve_grad

- backward_api : trace_grad
forward : trace (Tensor x, int offset, int axis1, int axis2) -> Tensor(out)
args : (Tensor x, Tensor out_grad, int offset, int axis1, int axis2)
Expand Down
10 changes: 0 additions & 10 deletions paddle/phi/api/yaml/legacy_api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1975,16 +1975,6 @@
use_gpudnn : true
backward : softmax_grad

- api : solve
args : (Tensor x, Tensor y)
output : Tensor
infer_meta :
func : SolveInferMeta
kernel :
func : solve
data_type : x
backward : solve_grad

- api : split
args : (Tensor x, IntArray num_or_sections, Scalar(int) axis)
output : Tensor[]
Expand Down
10 changes: 0 additions & 10 deletions paddle/phi/api/yaml/legacy_backward.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1892,16 +1892,6 @@
func : softmax_grad
use_gpudnn : true

- backward_api : solve_grad
forward : solve (Tensor x, Tensor y) -> Tensor(out)
args : (Tensor x, Tensor y, Tensor out, Tensor out_grad)
output : Tensor(x_grad), Tensor(y_grad)
infer_meta :
func : GeneralBinaryGradInferMeta
param : [x, y]
kernel :
func : solve_grad

- backward_api : split_grad
forward : split (Tensor x, IntArray num_or_sections, Scalar axis) -> Tensor[](out)
args : (Tensor[] out_grad, Scalar axis = -1)
Expand Down
9 changes: 9 additions & 0 deletions paddle/phi/kernels/solve_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ limitations under the License. */

namespace phi {

/**
* @brief This kernrel is used to computes the solution of a square system of
* linear equations with a unique solution for input x and y.
* $$Out = X^-1 * Y$$
* @param ctx device context
* @param x the input tensor of solve
* @param y the input tensor of solve
* @param out the output tensor of solve
*/
template <typename T, typename Context>
void SolveKernel(const Context& dev_ctx,
const DenseTensor& x,
Expand Down
26 changes: 0 additions & 26 deletions paddle/phi/ops/compat/solve_sig.cc

This file was deleted.

0 comments on commit f71d642

Please sign in to comment.