Skip to content

Commit

Permalink
[pten] trans diagonal kernel into pten (#39575)
Browse files Browse the repository at this point in the history
* trans diagonal kernel into pten

* fix by code review
  • Loading branch information
2742195759 authored Feb 18, 2022
1 parent 7d6d384 commit 5c66338
Show file tree
Hide file tree
Showing 11 changed files with 687 additions and 446 deletions.
12 changes: 2 additions & 10 deletions paddle/fluid/operators/diagonal_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "paddle/fluid/operators/diagonal_op.h"
#include "paddle/fluid/framework/op_registry.h"

namespace paddle {
namespace operators {
Expand Down Expand Up @@ -169,18 +169,10 @@ DECLARE_NO_NEED_BUFFER_VARS_INFERER(DiagonalGradNoNeedBufferVarsInferer,
} // namespace paddle

namespace ops = paddle::operators;

REGISTER_OPERATOR(diagonal, ops::DiagonalOp, ops::DiagonalOpMaker,
ops::DiagonalGradOpMaker<paddle::framework::OpDesc>,
ops::DiagonalGradOpMaker<paddle::imperative::OpBase>);

REGISTER_OPERATOR(diagonal_grad, ops::DiagonalGradOp,
ops::DiagonalGradNoNeedBufferVarsInferer)

REGISTER_OP_CPU_KERNEL(diagonal, ops::DiagonalKernel<int>,
ops::DiagonalKernel<int64_t>, ops::DiagonalKernel<float>,
ops::DiagonalKernel<double>, ops::DiagonalKernel<bool>);

REGISTER_OP_CPU_KERNEL(diagonal_grad, ops::DiagonalGradKernel<int>,
ops::DiagonalGradKernel<int64_t>,
ops::DiagonalGradKernel<float>,
ops::DiagonalGradKernel<double>);
273 changes: 0 additions & 273 deletions paddle/fluid/operators/diagonal_op.cu

This file was deleted.

Loading

0 comments on commit 5c66338

Please sign in to comment.