Skip to content
Snippets Groups Projects
Commit f0e41abc authored by Jerome Hue's avatar Jerome Hue
Browse files

Add missing python binding for LeakyReset

The binding for the LeakyReset enumeration was missing, which was causing
an error when running python tests.
parent d0b9adfa
No related branches found
No related tags found
1 merge request!344feat: Reset to zero for Leaky
Pipeline #66663 passed
...@@ -400,6 +400,18 @@ void declare_LSTMOp(py::module &m) { ...@@ -400,6 +400,18 @@ void declare_LSTMOp(py::module &m) {
)mydelimiter"); )mydelimiter");
} }
void declare_LeakyResetEnum(py::module &m) {
py::enum_<LeakyReset>(m, "leaky_reset", R"doc(
Enumeration for the Leaky neuron reset mode.
Subtraction: Membrane potential is subtracted by threshold upon spiking.
ToZero : Membrane potential is forced to 0 upon spiking.
)doc")
.value("subtraction", LeakyReset::Subtraction)
.value("to_zero", LeakyReset::ToZero)
.export_values();
}
void declare_LeakyOp(py::module &m) { void declare_LeakyOp(py::module &m) {
m.def("Leaky", &Leaky, m.def("Leaky", &Leaky,
...@@ -441,6 +453,7 @@ void init_MetaOperatorDefs(py::module &m) { ...@@ -441,6 +453,7 @@ void init_MetaOperatorDefs(py::module &m) {
declare_PaddedMaxPoolingOp<2>(m); declare_PaddedMaxPoolingOp<2>(m);
// declare_PaddedMaxPoolingOp<3>(m); // declare_PaddedMaxPoolingOp<3>(m);
declare_LSTMOp(m); declare_LSTMOp(m);
declare_LeakyResetEnum(m);
declare_LeakyOp(m); declare_LeakyOp(m);
py::class_<MetaOperator_Op, std::shared_ptr<MetaOperator_Op>, OperatorTensor>(m, "MetaOperatorOp", py::multiple_inheritance()) py::class_<MetaOperator_Op, std::shared_ptr<MetaOperator_Op>, OperatorTensor>(m, "MetaOperatorOp", py::multiple_inheritance())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment