Skip to content

Commit

Permalink
add a comment about bailing early
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrookhart committed Feb 26, 2021
1 parent 6f62717 commit 89b7dee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/relay/transforms/simplify_expr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ class SimplifyConvPad : public SimplifyPattern {
std::string data_layout = attrs->data_layout;
std::set<char> image_dims({'H', 'W', 'D'});
Array<PrimExpr> padding;
// If we're padding a non-spatial dimension, don't simplify
// Convolution can only pad on spatial axes
for (size_t i = 0; i < param->pad_width.size(); ++i) {
if (!image_dims.count(data_layout[i])) {
for (size_t j = 0; j < param->pad_width[i].size(); ++j) {
Expand Down

0 comments on commit 89b7dee

Please sign in to comment.