qualia_plugin_snn.learningmodel.pytorch.layers.spikingjelly.QuantizedAdd module

Contain implementation of QuantizedAdd layer with support for SpikingJelly step_mode.

class qualia_plugin_snn.learningmodel.pytorch.layers.spikingjelly.QuantizedAdd.QuantizedAdd[source]

Bases: QuantizedAdd, StepModule

Add SpikingJelly’s step_mode support to Qualia’s QuantizedAdd layer.

__init__(quant_params: QuantizationConfigDict, step_mode: str = 's') None[source]

Construct QuantizedAdd.

Parameters:
  • step_mode (str) – SpikingJelly’s step_mode, either 's' or 'm', see spikingjelly.activation_based.layer.Linear

  • quant_params (QuantizationConfigDict)

Return type:

None

extra_repr() str[source]

Add step_mode to the __repr__ method.

Returns:

String representation of qualia_core.learningmodel.pytorch.layers.QuantizedAdd with step_mode.

Return type:

str

forward(a: Tensor, b: Tensor) Tensor[source]

Forward qualia_core.learningmodel.pytorch.layers.QuantizedAdd with step_mode support.

Parameters:
Returns:

Output tensor

Return type:

Tensor