From a992d8189fc041b9e37e2922806bb032ab981649 Mon Sep 17 00:00:00 2001 From: cmoineau <cyril.moineau@cea.fr> Date: Sun, 23 Mar 2025 19:12:42 +0000 Subject: [PATCH] Add forwardDType to Cast operator. --- include/aidge/operator/Cast.hpp | 6 ++++++ src/operator/Cast.cpp | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/include/aidge/operator/Cast.hpp b/include/aidge/operator/Cast.hpp index f003e30c3..f63bde83b 100644 --- a/include/aidge/operator/Cast.hpp +++ b/include/aidge/operator/Cast.hpp @@ -112,6 +112,12 @@ public: } } + /** + * @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 54eef17b6..001a20a53 100644 --- a/src/operator/Cast.cpp +++ b/src/operator/Cast.cpp @@ -36,6 +36,10 @@ Aidge::Cast_Op::Cast_Op(const DataType targetType) mOutputs[0]->setDataType(targetType); } +bool Aidge::Cast_Op::forwardDType(){ + mOutputs[0]->setDataType(mAttributes->getAttr<CastAttr::TargetType>()); + return true; +} void Aidge::Cast_Op::setBackend(const std::string& name, Aidge::DeviceIdx_t device) { if (Registrar<Cast_Op>::exists({name})) { -- GitLab