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 operationweight (
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: 1padding (
int
) – Size of the paddings added to the input on both sides of its spatial dimensions. Only zero-padding is supported. Default: 0dilation (
int
) – Dilation of the 1D convolution operation. Default: 1groups (
int
) – number of groups to divide input and output channels into, so as to perform a “grouped convolution”. Whengroups
is not 1,in_channels
andout_channels
must be divisible bygroups
, and the shape of weight should be(groups, out_channel // groups, in_channels // groups, kernel_size)
. Default: 1conv_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