Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QNN] Fix padding changes due to #3739 #3989

Merged
merged 1 commit into from
Sep 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/relay/pass/pattern_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,10 +465,12 @@ static inline Expr AvgPool2D(Expr data, Array<IndexExpr> pool_size, Array<IndexE
return CallNode::make(op, {data}, Attrs(attrs), {});
}

static inline Expr Pad(Expr data, Array<Array<IndexExpr>> pad_width, double pad_value) {
static inline Expr Pad(Expr data, Array<Array<IndexExpr>> pad_width, double pad_value,
std::string pad_mode) {
auto attrs = make_node<PadAttrs>();
attrs->pad_value = pad_value;
attrs->pad_width = std::move(pad_width);
attrs->pad_mode = std::move(pad_mode);
static const Op& op = Op::Get("nn.pad");
return CallNode::make(op, {data}, Attrs(attrs), {});
}
Expand Down
2 changes: 1 addition & 1 deletion src/relay/qnn/op/convolution.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Expr Conv2DPadInput(const Expr& data, const QnnConv2DAttrs* param) {
} else {
LOG(FATAL) << "qnn.conv2d does not support " << param->data_layout << " layout";
}
padded_data = Pad(data, pad_width, param->input_zero_point);
padded_data = Pad(data, pad_width, param->input_zero_point, "constant");
}
return padded_data;
}
Expand Down