Skip to content

Commit 2409674

Browse files
committed
wip support pad + qnn.conv2d folding
1 parent 613cb7e commit 2409674

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/relay/transforms/fold_explicit_padding.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ class SimplifyConvPad {
4949
conv1d_ = IsOp("nn.conv1d");
5050
conv2d_ = IsOp("nn.conv2d");
5151
conv3d_ = IsOp("nn.conv3d");
52-
conv_ = (conv1d_ || conv2d_ || conv3d_)({pad_, w_});
52+
qconv2d_ = IsOp("qnn.conv2d");
53+
conv_ = (conv1d_ || conv2d_ || conv3d_ || qconv2d_)({pad_, w_});
5354
pattern_ = conv_;
5455
}
5556

@@ -131,6 +132,8 @@ class SimplifyConvPad {
131132
attrs = GetAttrs(param, call_node->attrs.as<Conv2DAttrs>());
132133
} else if (node_map.count(conv3d_)) {
133134
attrs = GetAttrs(param, call_node->attrs.as<Conv3DAttrs>());
135+
} else if (node_map.count(qconv2d_)) {
136+
attrs = GetAttrs(param, call_node->attrs.as<Conv2DAttrs>());
134137
} else {
135138
return post;
136139
}
@@ -158,6 +161,7 @@ class SimplifyConvPad {
158161
DFPattern conv1d_;
159162
DFPattern conv2d_;
160163
DFPattern conv3d_;
164+
DFPattern qconv2d_;
161165
};
162166

163167
class SimplifyExplicitPadding {

0 commit comments

Comments
 (0)