From 97dc451f4a069c816722f37a79cc53e972b7e0dc Mon Sep 17 00:00:00 2001 From: Yang Yang Date: Thu, 4 Jan 2018 03:06:12 +0000 Subject: [PATCH] clean up --- paddle/framework/operator.cc | 8 -------- paddle/operators/elementwise_op.h | 5 ----- 2 files changed, 13 deletions(-) diff --git a/paddle/framework/operator.cc b/paddle/framework/operator.cc index 60f31635ac2..9e3ef5f4ca9 100644 --- a/paddle/framework/operator.cc +++ b/paddle/framework/operator.cc @@ -182,8 +182,6 @@ static const Tensor* GetTensorFromVar(const Variable* var) { const Tensor* t = nullptr; if (var->IsType()) { t = &(var->Get()); - } else if (var->IsType()) { - t = &(var->Get()); } else if (var->IsType()) { t = &(var->Get().value()); } else { @@ -197,8 +195,6 @@ static Tensor* GetMutableTensorFromVar(Variable* var) { Tensor* t = nullptr; if (var->IsType()) { t = var->GetMutable(); - } else if (var->IsType()) { - t = var->GetMutable(); } else if (var->IsType()) { t = var->GetMutable()->mutable_value(); } else { @@ -362,8 +358,6 @@ class RuntimeInferShapeContext : public InferShapeContext { Variable* var = scope_.FindVar(name); if (var->IsType()) { return var->Get().dims(); - } else if (var->IsType()) { - return var->Get().dims(); } else if (var->IsType()) { return var->Get().GetCompleteDims(); } else { @@ -376,8 +370,6 @@ class RuntimeInferShapeContext : public InferShapeContext { Variable* var = scope_.FindVar(name); if (var->IsType()) { var->GetMutable()->Resize(dim); - } else if (var->IsType()) { - var->GetMutable()->Resize(dim); } else if (var->IsType()) { var->GetMutable()->set_height(dim[0]); } else { diff --git a/paddle/operators/elementwise_op.h b/paddle/operators/elementwise_op.h index 4128a3b1dcd..f308ee05e11 100644 --- a/paddle/operators/elementwise_op.h +++ b/paddle/operators/elementwise_op.h @@ -34,8 +34,6 @@ class ElementwiseOp : public framework::OperatorWithKernel { auto x_dim = ctx->GetInputDim("X"); auto y_dim = ctx->GetInputDim("Y"); - LOG(INFO) << x_dim; - LOG(INFO) << y_dim; PADDLE_ENFORCE_GE(x_dim.size(), y_dim.size(), "Rank of first input must >= rank of second input."); ctx->SetOutputDim("Out", x_dim); @@ -119,9 +117,6 @@ class ElementwiseOpGrad : public framework::OperatorWithKernel { auto x_dims = ctx->GetInputDim("X"); auto y_dims = ctx->GetInputDim("Y"); auto out_dims = ctx->GetInputDim(framework::GradVarName("Out")); - LOG(INFO) << x_dims; - LOG(INFO) << y_dims; - LOG(INFO) << out_dims; PADDLE_ENFORCE_GE(x_dims.size(), y_dims.size(), "Rank of first input must >= rank of second input."); -- GitLab