Skip to content

Commit

Permalink
【Bug Fixes】Elementwise_add triple grad, fixed an input uninitialized …
Browse files Browse the repository at this point in the history
…problem (#36618)

* Support elementwise_add triple grad Kernel

* Change code-format to follow CI std

* Removed unreasonable code, and fixed an input uninitialized issue

* Support elementwise_add triple grad Kernel

* Change code-format to follow CI std

* Removed unreasonable code, and fixed an input uninitialized issue
  • Loading branch information
veyron95 authored Oct 22, 2021
1 parent f46311b commit 6580ad1
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions paddle/fluid/operators/elementwise/elementwise_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,18 +445,7 @@ class ElementwiseOpTripleGrad : public framework::OperatorWithKernel {
framework::OpKernelType GetExpectedKernelType(
const framework::ExecutionContext &ctx) const override {
framework::proto::VarType::Type input_data_type;
if (ctx.HasInput("DDX") == false) {
OP_INOUT_CHECK(ctx.HasInput("DDY"), "Input", "DDY",
"ElementwiseOpTripleGrad");
input_data_type = OperatorWithKernel::IndicateVarDataType(ctx, "DDY");
} else if (ctx.HasInput("DDY") == false) {
OP_INOUT_CHECK(ctx.HasInput("DDX"), "Input", "DDX",
"ElementwiseOpTripleGrad");
input_data_type = OperatorWithKernel::IndicateVarDataType(ctx, "DDX");
} else {
input_data_type =
OperatorWithKernel::IndicateOrPromoteVarDataTypes(ctx, "DDX", "DDY");
}
input_data_type = OperatorWithKernel::IndicateVarDataType(ctx, "D_DDOut");

#ifdef PADDLE_WITH_MKLDNN
if (this->CanMKLDNNBeUsed(ctx, input_data_type)) {
Expand Down

0 comments on commit 6580ad1

Please sign in to comment.