We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e49e50 commit cf04cc9Copy full SHA for cf04cc9
backends/nxp/quantizer/patterns.py
@@ -691,6 +691,16 @@ def get_anchors(
691
output = []
692
activation.meta["quantization_annotation"].input_qspec_map = {}
693
694
+ # In order for QAT to be numerically correct, there should be no quantization between
695
+ # linear node and batch norm node.
696
+ if self.is_qat:
697
+ linear_users = linear_node.users
698
+ possibly_bn = (
699
+ list(linear_users.keys())[0] if len(linear_users) == 1 else None
700
+ )
701
+ if possibly_bn and _is_batch_norm(possibly_bn):
702
+ output = []
703
+
704
return PartitionAnchors(
705
inputs=[(linear_node, NodeArgsIdx(0))],
706
weights=[(linear_node, NodeArgsIdx(1))],
0 commit comments