yongwww commented on code in PR #14238:
URL: https://github.com/apache/tvm/pull/14238#discussion_r1129811203
##########
src/relax/op/nn/convolution.cc:
##########
@@ -142,5 +142,149 @@ TVM_REGISTER_OP("relax.nn.conv2d")
.set_attrs_type<Conv2DAttrs>()
.set_attr<FInferStructInfo>("FInferStructInfo", InferStructInfoConv2d);
+/* relax.nn.conv2d_transpose */
+TVM_REGISTER_NODE_TYPE(Conv2DTransposeAttrs);
+
+Expr conv2d_transpose(Expr data, Expr weight, Array<IntImm> strides,
Array<IntImm> padding,
+ Array<IntImm> output_padding, Array<IntImm> dilation,
int groups,
+ String data_layout, String kernel_layout,
Optional<String> out_layout,
+ DataType out_dtype) {
+ padding = GetCompletePadding2D(std::move(padding));
+ if (output_padding.size() == 1) {
+ output_padding.push_back(output_padding[0]);
+ }
+ if (strides.size() == 1) {
+ strides.push_back(strides[0]);
+ }
+ if (dilation.size() == 1) {
+ dilation.push_back(dilation[0]);
+ }
+
+ CHECK_GT(groups, 0) << "The number of groups in convolution is expected to
be positive. However, "
+ "the given number of groups is "
+ << groups;
+ CHECK_EQ(output_padding.size(), 2) << "The input output_padding length is
expected to be 4. "
Review Comment:
typo: -> `is expected to be 2`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]