@@ -384,7 +384,7 @@ class ViewCopyConfig(GenericNodePartitionerConfig):
384384 target_name = "view_copy.default"
385385
386386 def supported_precision_types (self ) -> List [ConfigPrecisionType ]:
387- return [ConfigPrecisionType .FP32 ]
387+ return [ConfigPrecisionType .FP32 , ConfigPrecisionType . STATIC_QUANT ]
388388
389389 def check_constraints (self , node : torch .fx .Node , ep : ExportedProgram ) -> bool :
390390 """
@@ -722,3 +722,24 @@ class CosConfig(GenericNodePartitionerConfig):
722722
723723 def supported_precision_types (self ) -> List [ConfigPrecisionType ]:
724724 return [ConfigPrecisionType .FP32 ]
725+
726+
727+ class UnsqueezeCopyConfig (GenericNodePartitionerConfig ):
728+ target_name = "unsqueeze_copy.default"
729+
730+ def supported_precision_types (self ) -> List [ConfigPrecisionType ]:
731+ return [ConfigPrecisionType .FP32 , ConfigPrecisionType .STATIC_QUANT ]
732+
733+ def check_constraints (self , node : torch .fx .Node , ep : ExportedProgram ) -> bool :
734+ if not self .check_common_constraints (node , ep ):
735+ return False
736+
737+ # The XNNPACK UnsqueezeVisitor only supports unsqueeze on the trailing
738+ # dimension. Mirrors the runtime check in op_squeeze.py.
739+ dim = node .args [1 ]
740+ input_rank = len (node .args [0 ].meta ["val" ].shape )
741+ if dim != - 1 and dim != input_rank :
742+ why (node , reason = "unsqueeze_copy only supported on the trailing dimension" )
743+ return False
744+
745+ return True
0 commit comments