megengine.functional.nn.local_conv2d

local_conv2d(inp, weight, bias=None, stride=1, padding=0, dilation=1, conv_mode='cross_correlation')[source]

Applies a spatial convolution with untied kernels over an groupped channeled input 4D tensor. It is also known as the locally connected layer.

Parameters
  • inp (Tensor) – input feature map.

  • weight (Tensor) – convolution kernel. weight usually has shape (out_channels, in_channels, height, width).

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

  • stride (Union[int, Tuple[int, int]]) – stride of the 2D convolution operation. Default: 1

  • padding (Union[int, Tuple[int, int]]) – size of the paddings added to the input on both sides of its spatial dimensions. Only zero-padding is supported. Default: 0

  • dilation (Union[int, Tuple[int, int]]) – dilation of the 2D convolution operation. Default: 1

Returns

output tensor.