Skip to content
Snippets Groups Projects
Commit 60f51b7a authored by Olivier BICHLER's avatar Olivier BICHLER
Browse files

Fix of the previous fix

parent 911170b5
No related branches found
No related tags found
2 merge requests!318[Upd] release verision 0.5.0,!290[Add] support for auto-concatenation and Fix multiple adaptToBackend() issues
Pipeline #62639 passed
......@@ -716,24 +716,24 @@ Aidge::MemoryManager Aidge::Scheduler::generateMemoryAutoConcat(bool incProducer
// Compute concatOffset
for (auto concatParent : concat->getParents()) {
const auto parentOp = std::static_pointer_cast<OperatorTensor>(concatParent->getOperator());
const auto parentRequiredSize = parentOp->getRequiredMemory(outputIdx, {});
const auto parentOutputDims = (parentOp->getOutput(outputIdx)) ? parentOp->getOutput(outputIdx)->dims() : std::vector<DimSize_t>();
const auto parentOutputFormat = (parentOp->getOutput(outputIdx)) ? parentOp->getOutput(outputIdx)->dataFormat() : DataFormat::Default;
if (concatParent == node) {
if (parentOutputFormat != DataFormat::NHWC) {
concatSize = parentRequiredSize.data;
}
break;
}
else {
const auto parentOp = std::static_pointer_cast<OperatorTensor>(concatParent->getOperator());
const auto parentRequiredSize = parentOp->getRequiredMemory(outputIdx, {});
const auto parentOutputDims = (parentOp->getOutput(outputIdx)) ? parentOp->getOutput(outputIdx)->dims() : std::vector<DimSize_t>();
const auto parentOutputFormat = (parentOp->getOutput(outputIdx)) ? parentOp->getOutput(outputIdx)->dataFormat() : DataFormat::Default;
// By default, specifies a fully monolithic memory block
std::size_t parentSize = parentRequiredSize.data;
if (parentOutputFormat == DataFormat::NHWC) {
parentSize = parentOutputDims.end()[-3];
}
else {
concatSize = parentSize;
}
concatOffset += parentSize;
}
......
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