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
4 merge requests!414Update version 0.5.1 -> 0.6.0,!408[Add] Dropout Operator,!341Error,!328Add a Backward Pass for the MetaOperators
Pipeline #65298 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