diff --git a/include/aidge/operator/MetaOperator.hpp b/include/aidge/operator/MetaOperator.hpp index 73a5c6a99fc06640df4f984dd8b8a291c3b3d783..744564b4bd591d84b871a6af71c4a54589103485 100644 --- a/include/aidge/operator/MetaOperator.hpp +++ b/include/aidge/operator/MetaOperator.hpp @@ -108,6 +108,7 @@ public: Elts_t getNbProducedData(IOIndex_t outputIdx) const override; void updateConsummerProducer() override; + void resetConsummerProducer() override; void forward() override; void backward() override { AIDGE_THROW_OR_ABORT(std::runtime_error, "backward() not implemented yet for a MetaOperator"); diff --git a/src/operator/MetaOperator.cpp b/src/operator/MetaOperator.cpp index 7362f67fcce97cc6861edd2b334758801d060ade..e7c50033797c7c984b6b8da69d30f005bc69e70c 100644 --- a/src/operator/MetaOperator.cpp +++ b/src/operator/MetaOperator.cpp @@ -134,6 +134,20 @@ Aidge::Elts_t Aidge::MetaOperator_Op::getNbProducedData(IOIndex_t outputIdx) con } } +void Aidge::MetaOperator_Op::resetConsummerProducer() { + if (mImpl) { + mImpl->resetConsummerProducer(); + } + else { + if (!mScheduler) { + // Lazy initialization + mScheduler = std::make_shared<SequentialScheduler>(mGraph, mUpperNode.lock()); + } + + mScheduler->resetScheduling(); + } +} + void Aidge::MetaOperator_Op::updateConsummerProducer() { if (mImpl) { mImpl->updateConsummerProducer();