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

OperatorTensor::forwarDType no longer require in tensor to be defined.

parent 20336414
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.
...@@ -173,7 +173,7 @@ bool Aidge::OperatorTensor::forwardDType(){ ...@@ -173,7 +173,7 @@ bool Aidge::OperatorTensor::forwardDType(){
Log::debug("Running default forwardDtype for operator {}", Log::debug("Running default forwardDtype for operator {}",
type()); type());
if (inputsAssociated()) { if (inputsAssociated(false)) {
const auto expectedDType = getInput(0)->dataType(); const auto expectedDType = getInput(0)->dataType();
for (std::size_t i = 1; i < nbInputs(); ++i) { for (std::size_t i = 1; i < nbInputs(); ++i) {
if (inputCategory(i) == InputCategory::OptionalParam if (inputCategory(i) == InputCategory::OptionalParam
...@@ -182,7 +182,7 @@ bool Aidge::OperatorTensor::forwardDType(){ ...@@ -182,7 +182,7 @@ bool Aidge::OperatorTensor::forwardDType(){
continue; continue;
} }
if (expectedDType != getInput(i)->dataType()) { if (expectedDType != getInput(i)->dataType()) {
Log::notice("{} operator's inputs should have the same datatype: expected {} (input #0), given {} (input #{})", Log::info("{} operator's inputs should have the same datatype: expected {} (input #0), given {} (input #{})",
type(), expectedDType, getInput(i)->dataType(), i); type(), expectedDType, getInput(i)->dataType(), i);
return false; return false;
} }
...@@ -194,6 +194,8 @@ bool Aidge::OperatorTensor::forwardDType(){ ...@@ -194,6 +194,8 @@ bool Aidge::OperatorTensor::forwardDType(){
mOutputs[o]->setDataType(expectedDType); mOutputs[o]->setDataType(expectedDType);
} }
return true; return true;
}else{
Log::info("Inputs are not associated, fail to forward data types.");
} }
return false; return false;
......
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