Skip to content
Snippets Groups Projects

[Fix]/[Upd] GlobalAvgPooling::forwardDims() squeeze dimensions

Merged Maxence Naud requested to merge fix_195_globalavgpool-forwarddims into dev
Files
2
@@ -44,8 +44,10 @@ bool Aidge::GlobalAveragePooling_Op::forwardDims(bool /*allowDataDependency*/) {
@@ -44,8 +44,10 @@ bool Aidge::GlobalAveragePooling_Op::forwardDims(bool /*allowDataDependency*/) {
// Global average pooling takes each filter, averages its values and uses
// Global average pooling takes each filter, averages its values and uses
// it as an output(Much like a fancier flatten). 1st dim is batch 2nd is
// it as an output(Much like a fancier flatten). 1st dim is batch 2nd is
// number of filter
// number of filter
mOutputs[0]->resize({getInput(0)->dims().at(0),
std::vector<DimSize_t> outputDims(getInput(0)->nbDims(), 1);
getInput(0)->dims().at(1)});
outputDims[0] = getInput(0)->dims()[0];
 
outputDims[1] = getInput(0)->dims()[1];
 
mOutputs[0]->resize(outputDims);
return true;
return true;
}
}
Loading