Skip to content

Commit

Permalink
pooling.cc improvements (apache#4767)
Browse files Browse the repository at this point in the history
  • Loading branch information
apivovarov authored and zhiics committed Mar 2, 2020
1 parent 7dbe80f commit c37198f
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/relay/op/nn/pooling.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,7 @@ bool Pool2DRel(const Array<Type>& types,
return false;
}

std::vector<IndexExpr> oshape;
for (const auto& e : dshape) {
oshape.push_back(e);
}
std::vector<IndexExpr> oshape(dshape.begin(), dshape.end());

if (dshape[hidx].as<tir::AnyNode>()) {
oshape[hidx] = dshape[hidx];
Expand Down Expand Up @@ -775,10 +772,7 @@ bool Pool1DRel(const Array<Type>& types,
return false;
}

std::vector<IndexExpr> oshape;
for (const auto& e : dshape) {
oshape.push_back(e);
}
std::vector<IndexExpr> oshape(dshape.begin(), dshape.end());

if (dshape[widx].as<tir::AnyNode>()) {
oshape[widx] = dshape[widx];
Expand Down Expand Up @@ -966,12 +960,9 @@ bool Pool3DRel(const Array<Type>& types,
return false;
}

std::vector<IndexExpr> oshape;
for (const auto& e : dshape) {
oshape.push_back(e);
}
std::vector<IndexExpr> oshape(dshape.begin(), dshape.end());

std::vector<int> idxes = {didx, hidx, widx};
int idxes[3] = {didx, hidx, widx};
for (int i = 0; i < 3; i++) {
int ii = idxes[i];
if (dshape[ii].as<tir::AnyNode>()) {
Expand Down

0 comments on commit c37198f

Please sign in to comment.