Skip to content
Snippets Groups Projects
Commit 445ba9c1 authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Add forwardDType to Cast operator.

parent 5c58ede2
No related branches found
No related tags found
3 merge requests!414Update version 0.5.1 -> 0.6.0,!408[Add] Dropout Operator,!363Add first version of forwardDType.
...@@ -98,6 +98,12 @@ public: ...@@ -98,6 +98,12 @@ public:
*/ */
Cast_Op(const Cast_Op& op); 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. * @brief Clone the operator using its copy constructor.
* @return A shared pointer to the cloned operator. * @return A shared pointer to the cloned operator.
......
...@@ -49,6 +49,11 @@ Cast_Op::Cast_Op(const Cast_Op& op) ...@@ -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 { void Aidge::Cast_Op::setDataType(const DataType& dataType) const {
if (targetType() != dataType) { if (targetType() != dataType) {
Log::warn("Cast::setDataType(): Cannot setDataType for cast operator."); Log::warn("Cast::setDataType(): Cannot setDataType for cast operator.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment