You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Arm backend: Fix Mypy error related to _QuantProperty.qspec
Previously, _QuantProperty.qspec had the type hint
`type[QuantizationSpecBase] | List[type[QuantizationSpecBase]]`, which
implies that _QuantProperty.qspec should be a class object. However, in
torchao the class `QuantizationAnnotation` has this property:
`output_qspec: Optional[QuantizationSpecBase] = None`
which is set to _QuantProperty.qspec through a series of function calls.
`output_qspec` should, as the type hinting implies, be an instance of a
class of `QuantizationSpecBase`, not a class object.
Therefore, change
`type[QuantizationSpecBase] | List[type[QuantizationSpecBase]]` to
`QuantizationSpecBase | List[QuantizationSpecBase]`. This allows us to
remove a bunch of mypy ignores.
Change-Id: Idbb5ca4ba9ab17e8805b1e4d647e46e86f434b69
Signed-off-by: Sebastian Larsson <[email protected]>
0 commit comments