Skip to content

QuantDepthwiseConv2d

Bases: QuantBase

Int8-quantized depthwise 2-D convolution with optional BatchNorm and ReLU.

Each input channel is convolved with its own [1, kH, kW] kernel (groups = channels). BN parameters are folded into the weight for schema export.

Parameters:

Name Type Description Default
channels int

Number of input / output channels.

required
kernel_size int | tuple[int, int]

Kernel size.

required
stride int | tuple[int, int]

Convolution stride.

1
padding int | tuple[int, int] | tuple[int, int, int, int]

Zero-padding. int or 2-tuple (pad_h, pad_w) or 4-tuple (L, R, T, B).

0
bias bool

Whether to include an additive bias.

True
device str

Torch device for the underlying parameters.

'cpu'
act_func str | None

Either "relu" or None.

None
ema_constant float

EMA smoothing factor for observers.

0.01
bn bool

If True, append a BatchNorm2d layer and fold it into weights for schema export.

False