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

Merge branch 'users/cguillon/dev-pybind-memorize' into 'dev'

[Memorize] Add python binding for Memorize

See merge request !198
parents 1f26e48b bd5dd3bb
No related branches found
No related tags found
2 merge requests!212Version 0.3.0,!198[Memorize] Add python binding for Memorize
Pipeline #54451 passed
......@@ -37,7 +37,7 @@ public:
enum class MemorizeAttr { ScheduleStep, ForwardStep, EndStep };
class Memorize_Op : public OperatorTensor,
public Registrable<Memorize_Op, std::string, std::unique_ptr<OperatorImpl>(const Memorize_Op&)> {
public Registrable<Memorize_Op, std::string, std::shared_ptr<OperatorImpl>(const Memorize_Op&)> {
public:
static const std::string Type;
......
/********************************************************************************
* Copyright (c) 2023 CEA-List
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
********************************************************************************/
#include <pybind11/pybind11.h>
#include <string>
#include <vector>
#include "aidge/operator/Memorize.hpp"
#include "aidge/operator/OperatorTensor.hpp"
namespace py = pybind11;
namespace Aidge {
void init_Memorize(py::module& m) {
py::class_<Memorize_Op, std::shared_ptr<Memorize_Op>, OperatorTensor>(m, "MemorizeOp", py::multiple_inheritance())
.def(py::init<const std::uint32_t>(), py::arg("end_step"))
.def_static("get_inputs_name", &Memorize_Op::getInputsName)
.def_static("get_outputs_name", &Memorize_Op::getOutputsName);
declare_registrable<Memorize_Op>(m, "MemorizeOp");
m.def("Memorize", &Memorize, py::arg("end_step"), py::arg("name") = "");
}
} // namespace Aidge
......@@ -47,6 +47,7 @@ void init_Identity(py::module&);
void init_LeakyReLU(py::module&);
void init_MatMul(py::module&);
void init_MaxPooling(py::module&);
void init_Memorize(py::module&);
void init_MetaOperatorDefs(py::module&);
void init_Mul(py::module&);
void init_Pad(py::module&);
......@@ -126,6 +127,7 @@ void init_Aidge(py::module& m) {
init_LeakyReLU(m);
init_MatMul(m);
init_MaxPooling(m);
init_Memorize(m);
init_MetaOperatorDefs(m);
init_Mul(m);
init_Pad(m);
......
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