megengine.functional.quantized.conv_bias_activation

conv_bias_activation(inp, weight, bias, dtype=None, stride=1, padding=0, dilation=1, groups=1, nonlinear_mode='identity', conv_mode='cross_correlation', compute_mode='default')[source]

Convolution bias with activation operation, only for inference.

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

  • weight (Tensor) – convolution kernel.

  • bias (Tensor) – bias added to the result of convolution

  • 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

  • groups (int) – number of groups into which the input and output channels are divided, 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, height, width).

  • conv_mode – supports ‘cross_correlation’ or ‘convolution’. Default: ‘cross_correlation’

  • dtype – support for np.dtype, Default: np.int8

  • 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