@@ -315,6 +315,64 @@ struct Conv2DTransposeAttrs : public tvm::AttrsNode<Conv2DTransposeAttrs> {
315315 }
316316};
317317
318+ /* ! \brief Attributes used in 1D transposed convolution operator */
319+ struct Conv1DTransposeAttrs : public tvm ::AttrsNode<Conv1DTransposeAttrs> {
320+ IndexExpr channels;
321+ Array<IndexExpr> kernel_size;
322+ Array<IndexExpr> strides;
323+ Array<IndexExpr> padding;
324+ Array<IndexExpr> output_padding;
325+ Array<IndexExpr> dilation;
326+ int groups;
327+ std::string data_layout;
328+ std::string kernel_layout;
329+ std::string out_layout;
330+ DataType out_dtype;
331+
332+ TVM_DECLARE_ATTRS (Conv1DTransposeAttrs, " relay.attrs.Conv1DTransposeAttrs" ) {
333+ TVM_ATTR_FIELD (channels)
334+ .set_default (NullValue<IndexExpr>())
335+ .describe (" The dimensionality of the output space"
336+ " i.e. the number of output channels in the convolution." );
337+ TVM_ATTR_FIELD (kernel_size)
338+ .describe (" The dimensions of the convolution window." )
339+ .set_default (NullValue<Array<IndexExpr> >());
340+ TVM_ATTR_FIELD (strides).set_default (Array<IndexExpr>({1 }))
341+ .describe (" The strides of the convolution." );
342+ TVM_ATTR_FIELD (output_padding).set_default (Array<IndexExpr>({0 }))
343+ .describe (" Zero-padding added to one side of the output." );
344+ TVM_ATTR_FIELD (padding).set_default (Array<IndexExpr>({0 }))
345+ .describe (" Symmetric or asymmetric padding."
346+ " Single value: the input is implicitly zero-padded on both sides."
347+ " Two values: padding[0] is used for left input padding, "
348+ " padding[1] is used for right input padding," );
349+ TVM_ATTR_FIELD (dilation).set_default (Array<IndexExpr>({1 }))
350+ .describe (" Specifies the dilation rate to use for dilated convolution." );
351+ TVM_ATTR_FIELD (groups).set_default (1 )
352+ .describe (" Controls the connections between inputs and outputs."
353+ " At groups=1, all inputs are convolved to all outputs."
354+ " At groups=2, the operation becomes equivalent to having two convolution"
355+ " layers side by side, each seeing half the input channels, and producing"
356+ " half the output channels, and both subsequently concatenated." );
357+ TVM_ATTR_FIELD (data_layout).set_default (" NCW" )
358+ .describe (" Dimension ordering of data. Can be 'NCW', 'NWC', etc."
359+ " 'N', 'C', 'W' stands for batch, channel, and width"
360+ " dimensions respectively. Convolution is applied on the"
361+ " 'W' dimension." );
362+ TVM_ATTR_FIELD (kernel_layout).set_default (" OIW" )
363+ .describe (" Dimension ordering of data and weight. Can be 'OIW', 'OIW16o16i', etc."
364+ " 'O', 'I', 'W' stands for num_filter, input_channel, and width"
365+ " dimensions respectively." );
366+ TVM_ATTR_FIELD (out_layout).set_default (" " )
367+ .describe (" Dimension ordering of output. Can be 'NCW', 'NWC', etc."
368+ " 'N', 'C', 'W' stands for batch, channel, and width"
369+ " dimensions respectively. Default to be same as input layout." );
370+ TVM_ATTR_FIELD (out_dtype)
371+ .set_default (NullValue<DataType>())
372+ .describe (" Output data type, set to explicit type under mixed precision setting" );
373+ }
374+ };
375+
318376/* ! \brief Attributes for max pool operator */
319377struct MaxPool2DAttrs : public tvm ::AttrsNode<MaxPool2DAttrs> {
320378 Array<IndexExpr> pool_size;
0 commit comments