Skip to content

Commit aefdbaf

Browse files
committed
add snntorch neuronhook bugfix #258
1 parent b1f429a commit aefdbaf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

neurobench/hooks/neuron.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,15 @@ def hook_fn(self, layer, input, output):
6767
6868
"""
6969
if self.spiking:
70-
self.activation_outputs.append(output[0])
70+
if (
71+
self.layer.init_hidden
72+
and not self.layer.output
73+
and not isinstance(output, tuple)
74+
):
75+
self.activation_outputs.append(output)
76+
else:
77+
self.activation_outputs.append(output[0])
78+
7179
if hasattr(layer, "mem"):
7280
self.post_fire_mem_potential.append(layer.mem)
7381

0 commit comments

Comments
 (0)