diff --git a/paddle/framework/operator.cc b/paddle/framework/operator.cc index 60f31635ac214b66add6d0913b4287bf05858dfc..9e3ef5f4ca98814d69d96e1969ce8557c52069ba 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 4128a3b1dcd8a598a270a30852c92ddd9d134e1d..f308ee05e11210540e41cda4b9a896f9f96c4730 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.");