Summary
I encountered a reproducible issue when running recurrent snnTorch neuron modules in float64. Specifically, RLeaky and RSynaptic fail during forward execution with a dtype mismatch error.
This appears to affect high-precision workflows where users may reasonably expect model.double() or float64 inputs/states to work consistently.
Minimal reproduction
import torch
import snntorch as snn
x = torch.randn(2, 4, dtype=torch.float64)
rleaky = snn.RLeaky(beta=0.9, linear_features=4).double()
rleaky(x)
A similar failure is also reproducible with RSynaptic under the same float64 setup.
Expected behavior
Recurrent neuron modules should either:
- run correctly in
float64 when the module and inputs are converted to float64, or
- fail with a clearly documented limitation if
float64 is not intended to be supported.
Actual behavior
The forward pass fails with:
RuntimeError: mat1 and mat2 must have the same dtype, but got Float and Double
In my reproduction/validation runs, this behavior was stable across repeated reruns and affected at least:
Environment
torch: 2.8.0
snntorch: 0.9.4
python: 3.10
Additional notes
This issue matters for high-precision or numerically sensitive workflows, where converting the model and inputs to float64 is a reasonable expectation.
If float64 support is intentionally limited for these recurrent modules, an explicit documentation note or earlier validation error would still be very helpful.
Summary
I encountered a reproducible issue when running recurrent snnTorch neuron modules in
float64. Specifically,RLeakyandRSynapticfail during forward execution with a dtype mismatch error.This appears to affect high-precision workflows where users may reasonably expect
model.double()orfloat64inputs/states to work consistently.Minimal reproduction
A similar failure is also reproducible with
RSynapticunder the same float64 setup.Expected behavior
Recurrent neuron modules should either:
float64when the module and inputs are converted tofloat64, orfloat64is not intended to be supported.Actual behavior
The forward pass fails with:
In my reproduction/validation runs, this behavior was stable across repeated reruns and affected at least:
RLeakyRSynapticEnvironment
torch:2.8.0snntorch:0.9.4python:3.10Additional notes
This issue matters for high-precision or numerically sensitive workflows, where converting the model and inputs to
float64is a reasonable expectation.If
float64support is intentionally limited for these recurrent modules, an explicit documentation note or earlier validation error would still be very helpful.