bitorch.layers.qconv3d.QConv3dBase

class bitorch.layers.qconv3d.QConv3dBase(*args: Any, input_quantization: Optional[Union[Quantization, str]] = None, weight_quantization: Optional[Union[Quantization, str]] = None, gradient_cancellation_threshold: Optional[float] = None, **kwargs: Any)[source]

Methods

__init__

initialization function for quantization of inputs and weights.

forward

forward the input tensor through the activation and quantized convolution layer.

Attributes

__init__(*args: Any, input_quantization: Optional[Union[Quantization, str]] = None, weight_quantization: Optional[Union[Quantization, str]] = None, gradient_cancellation_threshold: Optional[float] = None, **kwargs: Any) None[source]

initialization function for quantization of inputs and weights.

Parameters:
  • input_quantization (Union[str, Quantization], optional) – quantization module or name of quantization function to apply on inputs before forwarding through the qconvolution layer. Defaults to None.

  • gradient_cancellation_threshold (Union[float, None], optional) – threshold for input gradient cancellation. Disabled if threshold is None. Defaults to None.

  • weight_quantization (Union[str, Quantization], optional) – quantization module or name of quantization function for weights. Defaults to None.

forward(input_tensor: Tensor) Tensor[source]

forward the input tensor through the activation and quantized convolution layer.

Parameters:

input_tensor (Tensor) – input tensor

Returns:

the activated and convoluted output tensor.

Return type:

Tensor