Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang Yang committed Jan 4, 2018
1 parent fccbc2f commit 97dc451
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
8 changes: 0 additions & 8 deletions paddle/framework/operator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ static const Tensor* GetTensorFromVar(const Variable* var) {
const Tensor* t = nullptr;
if (var->IsType<LoDTensor>()) {
t = &(var->Get<LoDTensor>());
} else if (var->IsType<Tensor>()) {
t = &(var->Get<Tensor>());
} else if (var->IsType<SelectedRows>()) {
t = &(var->Get<SelectedRows>().value());
} else {
Expand All @@ -197,8 +195,6 @@ static Tensor* GetMutableTensorFromVar(Variable* var) {
Tensor* t = nullptr;
if (var->IsType<LoDTensor>()) {
t = var->GetMutable<LoDTensor>();
} else if (var->IsType<Tensor>()) {
t = var->GetMutable<Tensor>();
} else if (var->IsType<SelectedRows>()) {
t = var->GetMutable<SelectedRows>()->mutable_value();
} else {
Expand Down Expand Up @@ -362,8 +358,6 @@ class RuntimeInferShapeContext : public InferShapeContext {
Variable* var = scope_.FindVar(name);
if (var->IsType<LoDTensor>()) {
return var->Get<LoDTensor>().dims();
} else if (var->IsType<Tensor>()) {
return var->Get<Tensor>().dims();
} else if (var->IsType<SelectedRows>()) {
return var->Get<SelectedRows>().GetCompleteDims();
} else {
Expand All @@ -376,8 +370,6 @@ class RuntimeInferShapeContext : public InferShapeContext {
Variable* var = scope_.FindVar(name);
if (var->IsType<LoDTensor>()) {
var->GetMutable<LoDTensor>()->Resize(dim);
} else if (var->IsType<Tensor>()) {
var->GetMutable<Tensor>()->Resize(dim);
} else if (var->IsType<SelectedRows>()) {
var->GetMutable<SelectedRows>()->set_height(dim[0]);
} else {
Expand Down
5 changes: 0 additions & 5 deletions paddle/operators/elementwise_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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.");
Expand Down

0 comments on commit 97dc451

Please sign in to comment.