Skip to content
Snippets Groups Projects
Commit 3d9f7779 authored by Olivier BICHLER's avatar Olivier BICHLER Committed by Maxence Naud
Browse files

Make Shape working with forwardDims()

parent 269145ad
No related branches found
No related tags found
No related merge requests found
......@@ -20,14 +20,8 @@
#include "aidge/utils/Types.h"
void Aidge::Shape_OpImpl::forward() {
const Shape_Op& op = dynamic_cast<const Shape_Op&>(mOp);
const auto start = op.start();
const auto end = op.end();
op.getOutput(0)->getImpl()->copyCast(std::next(op.getInput(0)->dims().data(),
start),
DataType::UInt64,
end - start + 1);
// Do nothing...
// Output is already valid after forwardDims()
}
///////////////////////////////////////////////
......@@ -75,6 +69,11 @@ bool Aidge::Shape_Op::forwardDims(bool /*allowDataDependency*/) {
AIDGE_ASSERT(roi> 1, "Invalid ROI for Shape");
mOutputs[0]->resize({roi});
// Ensure the output of this operator is valid after forwardDims():
mOutputs[0]->getImpl()->copyCast(std::next(getInput(0)->dims().data(),
start),
DataType::UInt64,
end - start + 1);
return true;
}
......
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