[Graph Matching] Fail to match Pad + MaxPooling
The graphRegex fails to match Pad + MaxPooling + ReLu when there is no ReLU.
Here is a minimal example:
import aidge_core
g = aidge_core.sequential([
aidge_core.PaddedMaxPooling2D([3, 3], "test", stride_dims=[2, 2], padding_dims=[1,1,1,1])
])
aidge_core.expand_metaops(g)
regx = "(MaxPooling2D|AvgPooling2D|GlobalAveragePooling)#->ReLU?; (MaxPooling2D|AvgPooling2D|GlobalAveragePooling)#<-Pad2D?"
aidge_core.fuse_to_metaops(g, regx, "PaddedPooling")
g.save("ResultingGraph")
This give the following graph:
%%{init: {'flowchart': { 'curve': 'monotoneY'}, 'fontFamily': 'Verdana' } }%%
flowchart TB
test_0(<em>PaddedPooling#0</em>):::metaCls
Pad2D_0("test_pad<br/><sub><em>(Pad2D#0)</em></sub>"):::rootCls
Pad2D_0-->|"0<br/>↓<br/>0"|test_0
input0((in#0)):::inputCls--->|"↓<br/>0"|Pad2D_0
test_0--->|"0<br/>↓"|output0((out#0)):::outputCls
classDef inputCls fill:#afa
classDef outputCls fill:#ffa
classDef externalCls fill:#ccc
classDef producerCls fill:#ccf
classDef genericCls fill:#f9f9ff,stroke-width:1px,stroke-dasharray: 5 5
classDef metaCls stroke-width:5px
classDef rootCls stroke:#f00
classDef producerCls_rootCls stroke:#f00,fill:#ccf
classDef genericCls_rootCls stroke:#f00,fill:#f9f9ff,stroke-width:1px,stroke-dasharray: 5 5
classDef metaCls_rootCls stroke:#f00,stroke-width:5px
Edited by Cyril Moineau