diff --git a/include/aidge/operator/Reshape.hpp b/include/aidge/operator/Reshape.hpp index f8bfaf73bb7b4d585af28377f5314822afdbfb94..4d0e21e27696262924fd5bd99673aea99081b750 100644 --- a/include/aidge/operator/Reshape.hpp +++ b/include/aidge/operator/Reshape.hpp @@ -122,6 +122,7 @@ public: /** * @brief Forward the data type. + * Output datatype is the same as input 0. * @return True if successful, false otherwise. */ bool forwardDType() override final; diff --git a/src/operator/Reshape.cpp b/src/operator/Reshape.cpp index b4cd272a18ab8a996507a3812a02c0735e665cca..3df66f293186dc88057dced68640420b265bb3d2 100644 --- a/src/operator/Reshape.cpp +++ b/src/operator/Reshape.cpp @@ -60,7 +60,10 @@ bool Aidge::Reshape_Op::dimsForwarded() const { return OperatorTensor::dimsForwarded(); } bool Aidge::Reshape_Op::forwardDType(){ - if (inputsAssociated()) { + // Note: Override required because shape input is an optional data. + // Meaning default implementation will fail since: + // input[0] dtype != input[1] dtype. + if (inputsAssociated(false)) { mOutputs[0]->setDataType(getInput(0)->dataType()); return true; }