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

Fixed a bug in Concat with negative axis

parent 7447e564
No related branches found
No related tags found
No related merge requests found
...@@ -49,7 +49,9 @@ std::shared_ptr<Aidge::Operator> Aidge::Concat_Op::clone() const { ...@@ -49,7 +49,9 @@ std::shared_ptr<Aidge::Operator> Aidge::Concat_Op::clone() const {
void Aidge::Concat_OpImpl::forward() { void Aidge::Concat_OpImpl::forward() {
const Concat_Op& op = dynamic_cast<const Concat_Op&>(mOp); const Concat_Op& op = dynamic_cast<const Concat_Op&>(mOp);
const DimSize_t axis = op.axis(); auto axis = op.axis();
const auto nbDimsInput0 = op.getInput(0)->nbDims();
axis = (axis < 0) ? axis + static_cast<std::int32_t>(nbDimsInput0) : axis;
assert(op.getInput(0) && "missing input in Concat operator"); assert(op.getInput(0) && "missing input in Concat operator");
for (IOIndex_t i = 1; i < mOp.nbInputs(); ++i) { for (IOIndex_t i = 1; i < mOp.nbInputs(); ++i) {
......
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