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 (pytorch#14814)
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.
cc @freddan80@per@zingo@oscarandersson8218@digantdesai
Signed-off-by: Sebastian Larsson <[email protected]>
0 commit comments