File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 2323
2424# Standard
2525from functools import partial
26- from typing import Optional
26+ from typing import Optional , Union
2727import logging
2828import math
2929import random
@@ -2388,7 +2388,7 @@ def get_act_scales(
23882388 model ,
23892389 dloader ,
23902390 qcfg : dict ,
2391- device : Optional [str | torch .device ] = None ,
2391+ device : Optional [Union [ str , torch .device ] ] = None ,
23922392):
23932393 """Compute smoothquant activation scales of quantized linear layers.
23942394 Model and examples are moved to selected device, if provided.
@@ -2420,7 +2420,7 @@ def get_act_scales(
24202420
24212421 for data_mb , _ in zip (pbar , range (n_samples )):
24222422 qcfg ["sample_id" ] += 1
2423- data_mb = move_to (data_mb , device )
2423+ data_mb = move_to (data_mb , dev )
24242424 if (
24252425 qcfg ["nbits_bmm1" ] < 32
24262426 or qcfg ["nbits_bmm2" ] < 32
You can’t perform that action at this time.
0 commit comments