megengine.functional.nn.conv1d#

conv1d(inp, weight, bias=None, stride=1, padding=0, dilation=1, groups=1, conv_mode='cross_correlation', compute_mode='default')[source]#

1D convolution operation.

Refer to Conv1d for more information.

Parameters:
  • inp (Tensor) – The feature map of the convolution operation

  • weight (Tensor) – The convolution kernel.

  • bias (Optional[Tensor]) – The bias added to the result of convolution (if given)

  • stride (int) – Stride of the 1D convolution operation. Default: 1

  • padding (int) – Size of the paddings added to the input on both sides of its spatial dimensions. Only zero-padding is supported. Default: 0

  • dilation (int) – Dilation of the 1D convolution operation. Default: 1

  • groups (int) – number of groups to divide input and output channels into, so as to perform a “grouped convolution”. When groups is not 1, in_channels and out_channels must be divisible by groups, and the shape of weight should be (groups, out_channel // groups, in_channels // groups, kernel_size). Default: 1

  • conv_mode – Supports ‘cross_correlation’. Default: ‘cross_correlation’.

  • compute_mode – When set to ‘default’, no special requirements will be placed on the precision of intermediate results. When set to ‘float32’, float32 would be used for accumulator and intermediate result, but only effective when input and output are of float16 dtype.

Return type:

Tensor