From c1362663c0c6cdb67a19ff2b8cbb035ef776fa41 Mon Sep 17 00:00:00 2001 From: Olivier BICHLER <olivier.bichler@cea.fr> Date: Tue, 6 Feb 2024 10:27:43 +0100 Subject: [PATCH] Fixed bug unrelated to the MR --- include/aidge/operator/Concat.hpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/include/aidge/operator/Concat.hpp b/include/aidge/operator/Concat.hpp index 06cc468bd..08df7822a 100644 --- a/include/aidge/operator/Concat.hpp +++ b/include/aidge/operator/Concat.hpp @@ -86,15 +86,21 @@ public: if (!getInput(i)) { AIDGE_THROW_OR_ABORT(std::runtime_error, "Every input should be associated with a Tensor"); } - associated &= (getInput(i)->nbDims() == firstInputNbDims); - for (DimSize_t dim = 0; dim < firstInputNbDims; ++dim) { - if (dim == getAttr<ConcatAttr::Axis>()) { - outputDims[dim] += getInput(i)->dims()[dim]; - } - else { - associated &= (getInput(i)->dims()[dim] == outputDims[dim]); + + if (getInput(i)->nbDims() == firstInputNbDims) { + for (DimSize_t dim = 0; dim < firstInputNbDims; ++dim) { + if (dim == getAttr<ConcatAttr::Axis>()) { + outputDims[dim] += getInput(i)->dims()[dim]; + } + else { + associated &= (getInput(i)->dims()[dim] == outputDims[dim]); + } } } + else { + associated = false; + break; + } } if (associated) { getOutput(0)->resize(outputDims); -- GitLab