I need to create a pattern matching to match all qnn.conv2d operators which are depthwise convolution operators. I saw that the EthosU integration does this by checking the kernel_layout attribute using the has_attr function. My problem is, I did a layout conversion before so both conv2d and depthwise conv2d have the same kernel_layout attribute.
I noticed that only the depthwise convolution operators have the groups attribute, so I was trying to match them, but I couldn’t find a way of saying “match any qnn.conv2d with attribute groups, no matter the value of the attribute”. Using something like this:
Works only for the qnn.conv2d operators which has the groups attribute set to 512. I was hoping I could do something like:
But sadly, none of them work.
Does anyone know a way to do this? Or perhaps another workaround?