From f6b518c9708ce07fa589234d8a43e8f2959cb01a Mon Sep 17 00:00:00 2001 From: dangqingqing Date: Thu, 14 Sep 2017 01:47:01 +0800 Subject: [PATCH] Fix elementwise_mul_op.cc --- paddle/operators/elementwise_mul_op.cc | 8 +++++--- paddle/pybind/pybind.cc | 4 ---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/paddle/operators/elementwise_mul_op.cc b/paddle/operators/elementwise_mul_op.cc index ae88ec1b306..e37c582adbe 100644 --- a/paddle/operators/elementwise_mul_op.cc +++ b/paddle/operators/elementwise_mul_op.cc @@ -31,7 +31,7 @@ class ElementWiseMulOp : public framework::OperatorWithKernel { auto y_dim = ctx.Input("Y")->dims(); PADDLE_ENFORCE_GE(x_dim.size(), y_dim.size(), "Rank of first input must >= rank of second input.") - ctx.Output("Out")->Resize(x_dim); + ctx.Output("Out")->Resize(x_dim); } }; @@ -80,8 +80,10 @@ class ElementWiseMulOpGrad : public framework::OperatorWithKernel { 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 *x_grad = + ctx.Output(framework::GradVarName("X")); + auto *y_grad = + ctx.Output(framework::GradVarName("Y")); PADDLE_ENFORCE_GE(x_dims.size(), y_dims.size(), "Rank of first input must >= rank of second input.") diff --git a/paddle/pybind/pybind.cc b/paddle/pybind/pybind.cc index 96c4e88845b..926e6014261 100644 --- a/paddle/pybind/pybind.cc +++ b/paddle/pybind/pybind.cc @@ -176,10 +176,6 @@ All parameter, weight, gradient are variables in Paddle. .def("set_int", [](Variable &var, int val) -> void { *var.GetMutable() = val; }) .def("get_int", [](const Variable &var) -> int { return var.Get(); }) - // .def("get_tensor", - // [](Variable &self) -> Tensor * { return - // self.GetMutable(); }, - // py::return_value_policy::reference) .def("get_tensor", [](Variable &self) -> LoDTensor * { return self.GetMutable(); -- GitLab