diff --git a/include/aidge/operator/Cast.hpp b/include/aidge/operator/Cast.hpp index cd37e47d84c9a03d047b38d6e5cd4f8e84423d2d..2adbcad3392c3033f78caa923fb3cd0b78f03703 100644 --- a/include/aidge/operator/Cast.hpp +++ b/include/aidge/operator/Cast.hpp @@ -98,6 +98,12 @@ public: */ Cast_Op(const Cast_Op& op); + /** + * @brief Forward the data type. + * @return True if successful, false otherwise. + */ + bool forwardDType() override final; + /** * @brief Clone the operator using its copy constructor. * @return A shared pointer to the cloned operator. diff --git a/src/operator/Cast.cpp b/src/operator/Cast.cpp index 128868dcd3f39c16316b67a09abe471c47b2df33..587310c068fadb26dff1495c02ec46a90b600b72 100644 --- a/src/operator/Cast.cpp +++ b/src/operator/Cast.cpp @@ -49,6 +49,11 @@ Cast_Op::Cast_Op(const Cast_Op& op) } } +bool Aidge::Cast_Op::forwardDType(){ + mOutputs[0]->setDataType(mAttributes->getAttr<CastAttr::TargetType>()); + return true; +} + void Aidge::Cast_Op::setDataType(const DataType& dataType) const { if (targetType() != dataType) { Log::warn("Cast::setDataType(): Cannot setDataType for cast operator.");