Commit 23ba37d4 by Alexander Pivovarov Committed by Wuwei Lin

pooling.cc improvements (#4767)

parent 4f92cfe5
...@@ -134,10 +134,7 @@ bool Pool2DRel(const Array<Type>& types, ...@@ -134,10 +134,7 @@ bool Pool2DRel(const Array<Type>& types,
return false; return false;
} }
std::vector<IndexExpr> oshape; std::vector<IndexExpr> oshape(dshape.begin(), dshape.end());
for (const auto& e : dshape) {
oshape.push_back(e);
}
if (dshape[hidx].as<tir::AnyNode>()) { if (dshape[hidx].as<tir::AnyNode>()) {
oshape[hidx] = dshape[hidx]; oshape[hidx] = dshape[hidx];
...@@ -775,10 +772,7 @@ bool Pool1DRel(const Array<Type>& types, ...@@ -775,10 +772,7 @@ bool Pool1DRel(const Array<Type>& types,
return false; return false;
} }
std::vector<IndexExpr> oshape; std::vector<IndexExpr> oshape(dshape.begin(), dshape.end());
for (const auto& e : dshape) {
oshape.push_back(e);
}
if (dshape[widx].as<tir::AnyNode>()) { if (dshape[widx].as<tir::AnyNode>()) {
oshape[widx] = dshape[widx]; oshape[widx] = dshape[widx];
...@@ -966,12 +960,9 @@ bool Pool3DRel(const Array<Type>& types, ...@@ -966,12 +960,9 @@ bool Pool3DRel(const Array<Type>& types,
return false; return false;
} }
std::vector<IndexExpr> oshape; std::vector<IndexExpr> oshape(dshape.begin(), dshape.end());
for (const auto& e : dshape) {
oshape.push_back(e);
}
std::vector<int> idxes = {didx, hidx, widx}; int idxes[3] = {didx, hidx, widx};
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
int ii = idxes[i]; int ii = idxes[i];
if (dshape[ii].as<tir::AnyNode>()) { if (dshape[ii].as<tir::AnyNode>()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment