Skip to content
Snippets Groups Projects
Commit 5238c2bc authored by Maxence Naud's avatar Maxence Naud
Browse files

Merge branch 'add_metaops_bwd' into 'dev'

Add a Backward Pass for the MetaOperators

See merge request !328
parents 09583aa5 e98f9c20
No related branches found
No related tags found
2 merge requests!341Error,!328Add a Backward Pass for the MetaOperators
Pipeline #65316 passed
...@@ -203,13 +203,8 @@ public: ...@@ -203,13 +203,8 @@ public:
/** /**
* @brief Perform the backward pass for the operator. * @brief Perform the backward pass for the operator.
*
* @note Currently not implemented.
*/ */
void backward() override { void backward() override;
AIDGE_THROW_OR_ABORT(std::runtime_error, "backward() not implemented yet for a MetaOperator");
}
/** /**
* @brief Check if the operator is atomic. * @brief Check if the operator is atomic.
* *
......
...@@ -273,6 +273,21 @@ void Aidge::MetaOperator_Op::forward() { ...@@ -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, 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