qualia_plugin_snn.learningmodel.pytorch.layers.spikingjelly.Add module

Contain implementation of Add layer with support for SpikingJelly step_mode.

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

Bases: Add, StepModule

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

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

Construct Add.

Parameters:

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

Return type:

None

extra_repr() str[source]

Add step_mode to the __repr__ method.

Returns:

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

Return type:

str

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

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

Parameters:
Returns:

Output tensor

Return type:

Tensor