From 541ea019f84381140f554a1b9dea19d0ef57dc19 Mon Sep 17 00:00:00 2001 From: cmoineau <cyril.moineau@cea.fr> Date: Fri, 20 Sep 2024 11:09:32 +0000 Subject: [PATCH] Make Sigmoid registrable. --- include/aidge/operator/Sigmoid.hpp | 4 ++-- python_binding/operator/pybind_Sigmoid.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/aidge/operator/Sigmoid.hpp b/include/aidge/operator/Sigmoid.hpp index 24bc33216..ceef45bf0 100644 --- a/include/aidge/operator/Sigmoid.hpp +++ b/include/aidge/operator/Sigmoid.hpp @@ -26,7 +26,7 @@ namespace Aidge { class Sigmoid_Op : public OperatorTensor, - public Registrable<Sigmoid_Op, std::string, std::function<std::unique_ptr<OperatorImpl>(const Sigmoid_Op&)>> { + public Registrable<Sigmoid_Op, std::string, std::function<std::shared_ptr<OperatorImpl>(const Sigmoid_Op&)>> { public: static const std::string Type; @@ -50,4 +50,4 @@ public: std::shared_ptr<Node> Sigmoid(const std::string& name = ""); } -#endif /* AIDGE_CORE_OPERATOR_SIGMOID_H_ */ \ No newline at end of file +#endif /* AIDGE_CORE_OPERATOR_SIGMOID_H_ */ diff --git a/python_binding/operator/pybind_Sigmoid.cpp b/python_binding/operator/pybind_Sigmoid.cpp index db7fc7bfb..09e0e2fa2 100644 --- a/python_binding/operator/pybind_Sigmoid.cpp +++ b/python_binding/operator/pybind_Sigmoid.cpp @@ -25,6 +25,8 @@ void init_Sigmoid(py::module& m) { .def_static("get_outputs_name", &Sigmoid_Op::getOutputsName) .def_readonly_static("Type", &Sigmoid_Op::Type); + declare_registrable<Sigmoid_Op>(m, "SigmoidOp"); + m.def("Sigmoid", &Sigmoid, py::arg("name") = ""); } } // namespace Aidge -- GitLab