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

Update Reshape::forwardDType().

parent da06710b
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.
...@@ -122,6 +122,7 @@ public: ...@@ -122,6 +122,7 @@ public:
/** /**
* @brief Forward the data type. * @brief Forward the data type.
* Output datatype is the same as input 0.
* @return True if successful, false otherwise. * @return True if successful, false otherwise.
*/ */
bool forwardDType() override final; bool forwardDType() override final;
......
...@@ -60,7 +60,10 @@ bool Aidge::Reshape_Op::dimsForwarded() const { ...@@ -60,7 +60,10 @@ bool Aidge::Reshape_Op::dimsForwarded() const {
return OperatorTensor::dimsForwarded(); return OperatorTensor::dimsForwarded();
} }
bool Aidge::Reshape_Op::forwardDType(){ 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()); mOutputs[0]->setDataType(getInput(0)->dataType());
return true; return true;
} }
......
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