Skip to content

Commit 7f748af

Browse files
committed
Need to specify types for collection assignment
Fixes: fms_mo/aiu_addons/i8i8/i8i8_aiu_adapter.py:66: error: Unsupported target for indexed assignment ("Mapping[str, Any]") [index] fms_mo/aiu_addons/i8i8/i8i8_aiu_adapter.py:67: error: Unsupported target for indexed assignment ("Mapping[str, Any]") [index] fms_mo/aiu_addons/i8i8/i8i8_aiu_adapter.py:75: error: Unsupported target for indexed assignment ("Mapping[str, Any]") [index] fms_mo/aiu_addons/i8i8/i8i8_aiu_adapter.py:82: error: Unsupported target for indexed assignment ("Mapping[str, Any]") [index] fms_mo/aiu_addons/i8i8/i8i8_aiu_adapter.py:87: error: Unsupported target for indexed assignment ("Mapping[str, Any]") [index] fms_mo/quant/quantizers.py:4161: error: Incompatible types in assignment (expression has type "list[int]", variable has type "None") [assignment] fms_mo/quant/quantizers.py:4161: error: Argument 1 to "len" has incompatible type "None"; expected "Sized" [arg-type] fms_mo/quant/quantizers.py:4162: error: Unsupported target for indexed assignment ("None") [index] fms_mo/quant/quantizers.py:4162: error: Value of type "None" is not indexable [index] Signed-off-by: Martin Hickey <[email protected]>
1 parent 7314f53 commit 7f748af

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

fms_mo/aiu_addons/i8i8/i8i8_aiu_adapter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"""Implement FMS adapter for INT8xINT8 checkpoints"""
1515

1616
# Standard
17-
from typing import Mapping
17+
from typing import Mapping, MutableMapping
1818

1919
# Third Party
2020
from fms.utils import serialization
@@ -46,7 +46,7 @@ def _int8_qparams_aiu(
4646

4747

4848
def _add_defaults_and_concat(
49-
new_sd: Mapping[str, torch.Tensor],
49+
new_sd: MutableMapping[str, torch.Tensor],
5050
modules_seen: set,
5151
) -> None:
5252
"""

fms_mo/quant/quantizers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4035,8 +4035,8 @@ def __init__(
40354035
self.reset_ReSig_param(multimodal)
40364036

40374037
self.beta = 2 / 3
4038-
self.Wshape = None
4039-
self.reshape2 = None
4038+
self.Wshape: list[Any] = list()
4039+
self.reshape2: list[Any] = list()
40404040

40414041
def forward(self, x):
40424042
if self.useSAWB:

0 commit comments

Comments
 (0)