未验证 提交 6580ad16 编写于 作者: W Weilong Wu 提交者: GitHub

【Bug Fixes】Elementwise_add triple grad, fixed an input uninitialized 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
上级 f46311b0
......@@ -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)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册