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

Use SET_IMPL_MACRO for metaop.

parent 2440e3dd
No related branches found
No related tags found
3 merge requests!414Update version 0.5.1 -> 0.6.0,!408[Add] Dropout Operator,!352Use SET_IMPL_MACRO for metaop.
Pipeline #66251 passed
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include "aidge/graph/GraphView.hpp" #include "aidge/graph/GraphView.hpp"
#include "aidge/utils/ErrorHandling.hpp" #include "aidge/utils/ErrorHandling.hpp"
#include "aidge/utils/DynamicAttributes.hpp" #include "aidge/utils/DynamicAttributes.hpp"
#include "aidge/utils/Registrar.hpp" // SET_IMPL_MACRO
Aidge::MetaOperator_Op::MetaOperator_Op(const std::string& type, const std::shared_ptr<GraphView>& graph, const std::vector<InputCategory>& forcedInputsCategory) Aidge::MetaOperator_Op::MetaOperator_Op(const std::string& type, const std::shared_ptr<GraphView>& graph, const std::vector<InputCategory>& forcedInputsCategory)
: OperatorTensor(type, [graph, forcedInputsCategory]() { : OperatorTensor(type, [graph, forcedInputsCategory]() {
...@@ -113,8 +115,7 @@ std::string Aidge::MetaOperator_Op::backend() const noexcept { ...@@ -113,8 +115,7 @@ std::string Aidge::MetaOperator_Op::backend() const noexcept {
void Aidge::MetaOperator_Op::setBackend(const std::string &name, Aidge::DeviceIdx_t device) { void Aidge::MetaOperator_Op::setBackend(const std::string &name, Aidge::DeviceIdx_t device) {
if (Registrar<MetaOperator_Op>::exists({name, type()})) { if (Registrar<MetaOperator_Op>::exists({name, type()})) {
// A custom implementation exists for this meta operator // A custom implementation exists for this meta operator
mImpl = Registrar<MetaOperator_Op>::create({name, type()})(*this); SET_IMPL_MACRO(MetaOperator_Op, *this, {name, type()});
// Set backend for in/out tensor of the MetaOp // Set backend for in/out tensor of the MetaOp
for(auto i: mGraph->inputNodes()){ for(auto i: mGraph->inputNodes()){
auto op_i = std::static_pointer_cast<OperatorTensor>(i->getOperator()); auto op_i = std::static_pointer_cast<OperatorTensor>(i->getOperator());
......
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