Skip to content

Commit 1873a6a

Browse files
perzingo
authored andcommitted
Arm backend: Port fix from xnnpack quantizer
Change-Id: I2713cc87256d3dd1228d91e46f8eaeee5737a3cf
1 parent a6cd1dc commit 1873a6a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backends/arm/quantizer/arm_quantizer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,16 @@ def _get_module_type_filter(tp: Callable) -> NodeFilterType:
191191
True # the node is from the submodule `Sub` (same for `Block` and `Linear` as well)
192192
"""
193193

194+
tp_str = tp.__module__ + "." + tp.__qualname__
195+
194196
def module_type_filter(n: Node) -> bool:
195197
# node_stack example: {
196198
# 'L__self___sub': ("L['self'].sub", <class '....Sub'>),
197199
# 'L__self___sub_linear': ("L['self'].sub.linear", <class 'torch.nn.modules.linear.Linear'>)
198200
# }
199201
nn_module_stack = n.meta.get("nn_module_stack", {})
200202
types = [t for _, t in nn_module_stack.values()]
201-
return tp in types
203+
return tp_str in types
202204

203205
return module_type_filter
204206

0 commit comments

Comments
 (0)