Hello,I am using DFPatternCallback to match some pattern in my module and rewriting its callback function to modify some value in it, but it doesn’t work as I presumed.
My network is from pytorch and look like this:
No nodes are added or deleted, so the architecture won’t change after my callback function.
and i am matching a pattern ,codes are:
self.input=wildcard()
self.weight=is_constant()
self.conv=is_op("nn.conv2d")
self.conv_result = self.conv(self.input,self.weight)
self.bias = is_constant()
self.add = is_op("add")
self.add_result = self.add(self.conv_result, self.bias)
self.relu = is_op("nn.relu")
self.relu_result = self.relu(self.add_result)
self.weight2 = is_constant()
self.conv2 = is_op("nn.conv2d")
self.pattern = self.conv2(self.relu_result,self.weight2)
I am imagine the 1st,2nd,3rd add node would be matched; but it turns out that only 1st and 3rd one is modified.
So my question is why is this pattern match not complete? and how can i do to make it work?
Thank you!