From 75062905e92b474993235bbdcbb95693856a1405 Mon Sep 17 00:00:00 2001 From: NAUD Maxence <maxence.naud@cea.fr> Date: Mon, 3 Jun 2024 08:47:14 +0000 Subject: [PATCH] fix identity_op dimension management --- include/aidge/operator/Identity.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/aidge/operator/Identity.hpp b/include/aidge/operator/Identity.hpp index 367aa4e2d..bcbe1c6c6 100644 --- a/include/aidge/operator/Identity.hpp +++ b/include/aidge/operator/Identity.hpp @@ -27,6 +27,8 @@ namespace Aidge { + + /** * @brief Indentity_Op is an helper operator made to ease the declaration of MetaNodes. * This Operator has no Implementation, it just forward its input Tensor. @@ -63,7 +65,7 @@ public: return std::make_shared<Identity_Op>(*this); } - bool forwardDims(bool /*allowDataDependency*/ = false) override final { return true; } // Do nothing + // bool forwardDims(bool /*allowDataDependency*/ = false) override final { return true; } // Do nothing /** * @brief Check if output dimensions have been computed. @@ -74,7 +76,7 @@ public: * @return false Input has no dimensions or is a nullptr. */ bool dimsForwarded() const override final { - return mInputs[0] ? !mInputs[0]->empty() : false; + return mInputs[0] ? (mInputs[0]->empty() ? false : mInputs[0]->dims() == mOutputs[0]->dims()) : false; } -- GitLab