Skip to content
Snippets Groups Projects
Commit 8ee82e64 authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Make MetaOperator registrable in Python.

parent c0903e2a
No related branches found
No related tags found
3 merge requests!279v0.4.0,!253v0.4.0,!163Export refactor
Pipeline #54870 failed
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
namespace Aidge { namespace Aidge {
class MetaOperator_Op : public OperatorTensor, class MetaOperator_Op : public OperatorTensor,
public Registrable<MetaOperator_Op, std::array<std::string, 2>, std::function<std::unique_ptr<OperatorImpl>(const MetaOperator_Op &)>> { public Registrable<MetaOperator_Op, std::array<std::string, 2>, std::function<std::shared_ptr<OperatorImpl>(const MetaOperator_Op &)>> {
public: public:
// outputs shared with micro-graph output Tensors // outputs shared with micro-graph output Tensors
// Micro-graph handling: // Micro-graph handling:
......
...@@ -194,12 +194,14 @@ void init_MetaOperatorDefs(py::module &m) { ...@@ -194,12 +194,14 @@ void init_MetaOperatorDefs(py::module &m) {
// declare_PaddedMaxPoolingOp<3>(m); // declare_PaddedMaxPoolingOp<3>(m);
declare_LSTMOp(m); declare_LSTMOp(m);
py::class_<MetaOperator_Op, std::shared_ptr<MetaOperator_Op>, OperatorTensor>(m, "MetaOperator_Op", py::multiple_inheritance()) py::class_<MetaOperator_Op, std::shared_ptr<MetaOperator_Op>, OperatorTensor>(m, "MetaOperatorOp", py::multiple_inheritance())
.def(py::init<const char *, const std::shared_ptr<GraphView>&>(), .def(py::init<const char *, const std::shared_ptr<GraphView>&>(),
py::arg("type"), py::arg("type"),
py::arg("graph")) py::arg("graph"))
.def("get_micro_graph", &MetaOperator_Op::getMicroGraph); .def("get_micro_graph", &MetaOperator_Op::getMicroGraph);
declare_registrable<MetaOperator_Op>(m, "MetaOperatorOp");
m.def("meta_operator", &MetaOperator, m.def("meta_operator", &MetaOperator,
py::arg("type"), py::arg("type"),
py::arg("graph"), py::arg("graph"),
......
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