DepthwiseConv2d

class dragon.vm.torch.nn.DepthwiseConv2d(
  in_channels,
  out_channels,
  kernel_size,
  stride=1,
  padding=0,
  dilation=1,
  bias=True
)[source]

Apply the 2d depthwise convolution.

Examples:

m = torch.nn.DepthwiseConv2d(3, 3, 3, padding=1)
x = torch.ones(2, 3, 4, 4)
y = m(x)

__init__

DepthwiseConv2d.__init__(
  in_channels,
  out_channels,
  kernel_size,
  stride=1,
  padding=0,
  dilation=1,
  bias=True
)[source]

Create a DepthwiseConv2d module.

Parameters:
  • in_channels (int) The number of input channels.
  • out_channels (int) The number of output channels.
  • kernel_size (Union[int, Sequence[int]]) The size of convolution window.
  • stride (Union[int, Sequence[int]], optional, default=1) The stride of convolution window.
  • padding (Union[int, Sequence[int]], optional, default=0) The zero padding size.
  • dilation (Union[int, Sequence[int]], optional, default=1) The rate of dilated kernel.
  • bias (bool, optional, default=True) Add a bias tensor to output or not.