Skip to content
Snippets Groups Projects
Commit f4815323 authored by Gallas Gaye's avatar Gallas Gaye
Browse files

feat: Added AvgPooling2D export op

parent 90f53c3d
No related branches found
No related tags found
2 merge requests!39Update 0.2.1 -> 0.3.0,!36feat: Add missing operators for AIDGE model benchmarking
......@@ -86,7 +86,7 @@ void pooling_forward(
outputs[oOffset + output] = maxVal;
}
else if (POOLING_TYPE == Average) {
int32_t sum = 0;
Output_T sum = 0;
for (int sy = 0; sy < POOL_HEIGHT; ++sy) {
if ((PADDING_Y != 0
......
......@@ -248,6 +248,20 @@ class MaxPoolCPP(ExportNodeCpp):
_setup_pooling(self)
@ExportLibCpp.register("AvgPooling2D", aidge_core.ImplSpec(aidge_core.IOSpec(aidge_core.dtype.float32)))
class AvgPoolCPP(ExportNodeCpp):
def __init__(self, node, mem_info):
super().__init__(node, mem_info)
# No padding with MaxPooling
# Use PaddedMaxPooling to add padding attribute
self.attributes["padding"] = [0, 0]
self.attributes["pool_type"] = "Average"
self.attributes["activation"] = "Linear"
self.attributes["rescaling"] = "NoScaling"
_setup_pooling(self)
@ExportLibCpp.register_metaop("PaddedMaxPooling2D", aidge_core.ImplSpec(aidge_core.IOSpec(aidge_core.dtype.float32)))
class PaddedMaxPoolCPP(ExportNodeCpp):
def __init__(self, node, mem_info):
......
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