Skip to content
Snippets Groups Projects
Commit e98f9c20 authored by Benjamin Halimi's avatar Benjamin Halimi Committed by Maxence Naud
Browse files

add a backward pass for the metaoperators

parent 09583aa5
No related branches found
No related tags found
2 merge requests!341Error,!328Add a Backward Pass for the MetaOperators
Pipeline #65298 passed
......@@ -203,13 +203,8 @@ public:
/**
* @brief Perform the backward pass for the operator.
*
* @note Currently not implemented.
*/
void backward() override {
AIDGE_THROW_OR_ABORT(std::runtime_error, "backward() not implemented yet for a MetaOperator");
}
void backward() override;
/**
* @brief Check if the operator is atomic.
*
......
......@@ -273,6 +273,21 @@ void Aidge::MetaOperator_Op::forward() {
}
}
void Aidge::MetaOperator_Op::backward() {
if (mImpl) {
// A custom implementation exists for this meta operator
mImpl->backward();
}
else {
// No custom implementation, use the individual operators implementations
if (!mScheduler) {
mScheduler = std::make_shared<SequentialScheduler>(mGraph, mUpperNode.lock());
mScheduler->generateScheduling();
}
mScheduler->backward();
}
}
/////////////////////////////////////////////////
std::shared_ptr<Aidge::Node> Aidge::MetaOperator(const char *type,
......
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