Skip to content
Snippets Groups Projects

Fix getAdaptation()

Merged Olivier BICHLER requested to merge fix_adapt into dev
1 unresolved thread
1 file
+ 7
2
Compare changes
  • Side-by-side
  • Inline
@@ -235,6 +235,11 @@ bool Aidge::OperatorImpl::checkIOSpec(const ImplSpec::IOSpec& required, const Im
@@ -235,6 +235,11 @@ bool Aidge::OperatorImpl::checkIOSpec(const ImplSpec::IOSpec& required, const Im
}
}
std::shared_ptr<Aidge::Node> Aidge::OperatorImpl::getAdaptation(const ImplSpec& spec, const ImplSpec& requiredSpecs) const {
std::shared_ptr<Aidge::Node> Aidge::OperatorImpl::getAdaptation(const ImplSpec& spec, const ImplSpec& requiredSpecs) const {
 
// Original graph is:
 
// --> {required IO specs} [node] {required IO specs} -->
 
// Obtained meta-op is:
 
// --> {required IO specs} [adapt inputs] --> {IO specs} [node] {IO specs} --> [adapt outputs] {required IO specs}
 
auto op = std::static_pointer_cast<OperatorTensor>(mOp.clone());
auto op = std::static_pointer_cast<OperatorTensor>(mOp.clone());
auto node = std::make_shared<Node>(op);
auto node = std::make_shared<Node>(op);
@@ -306,7 +311,7 @@ std::shared_ptr<Aidge::Node> Aidge::OperatorImpl::getAdaptation(const ImplSpec&
@@ -306,7 +311,7 @@ std::shared_ptr<Aidge::Node> Aidge::OperatorImpl::getAdaptation(const ImplSpec&
cast->getOperator()->setBackend(node->getOperator()->backend());
cast->getOperator()->setBackend(node->getOperator()->backend());
parent->addChild(cast, i, 0);
parent->addChild(cast, i, 0);
op->getOutput(i)->setDataType(IOSpec.type);
op->getInput(i)->setDataType(IOSpec.type);
}
}
// Output format
// Output format
@@ -321,7 +326,7 @@ std::shared_ptr<Aidge::Node> Aidge::OperatorImpl::getAdaptation(const ImplSpec&
@@ -321,7 +326,7 @@ std::shared_ptr<Aidge::Node> Aidge::OperatorImpl::getAdaptation(const ImplSpec&
transposeOp->getOperator()->setBackend(node->getOperator()->backend());
transposeOp->getOperator()->setBackend(node->getOperator()->backend());
parent->addChild(transposeOp, i, 0);
parent->addChild(transposeOp, i, 0);
op->getOutput(i)->setDataFormat(IOSpec.format);
op->getInput(i)->setDataFormat(IOSpec.format);
}
}
// Output dims
// Output dims
Loading