From 50cf127eea23e8771c17844cf09becec61004e96 Mon Sep 17 00:00:00 2001 From: dongzhihong Date: Thu, 17 Aug 2017 17:12:23 -0700 Subject: [PATCH] "change Output to Input" --- paddle/operators/mul_op.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/operators/mul_op.cc b/paddle/operators/mul_op.cc index 329ab95327b..460e458ca4f 100644 --- a/paddle/operators/mul_op.cc +++ b/paddle/operators/mul_op.cc @@ -66,11 +66,11 @@ class MulOpGrad : public framework::OperatorWithKernel { PADDLE_ENFORCE_NOT_NULL(ctx.InputVar("Y"), "Input(Y) should not be null"); PADDLE_ENFORCE_NOT_NULL(ctx.InputVar(framework::GradVarName("Out")), "Input(Out@GRAD) should not be null"); - auto x_dims = ctx.Output("X")->dims(); - auto y_dims = ctx.Output("Y")->dims(); + auto x_dims = ctx.Input("X")->dims(); + auto y_dims = ctx.Input("Y")->dims(); + auto out_dims = ctx.Input(framework::GradVarName("Out"))->dims(); auto *x_grad = ctx.Output(framework::GradVarName("X")); auto *y_grad = ctx.Output(framework::GradVarName("Y")); - auto out_dims = ctx.Input(framework::GradVarName("Out"))->dims(); PADDLE_ENFORCE(x_dims[0] == out_dims[0], "Out@GRAD M X N must equal to X dims 0, M "); PADDLE_ENFORCE(y_dims[1] == out_dims[1], -- GitLab