File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
fastdeploy/model_executor/layers/quantization Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ def name(self) -> str:
63
63
@classmethod
64
64
def from_config (cls , config : dict ) -> "WeightOnlyConfig" :
65
65
algo = config ["algo" ]
66
- is_dyn_quant = config [ "is_dyn_quant" ] if "is_dyn_quant" in config else False
66
+ is_dyn_quant = config . get ( "is_dyn_quant" , False )
67
67
return cls (algo , is_dyn_quant )
68
68
69
69
def get_quant_method (self , layer ) -> Optional [QuantMethodBase ]:
@@ -148,7 +148,7 @@ def __init__(self, is_dyn_quant: bool = False) -> None:
148
148
149
149
@classmethod
150
150
def from_config (cls , config : dict ) -> "WINT8Config" :
151
- is_dyn_quant = config [ "is_dyn_quant" ] if "is_dyn_quant" in config else False
151
+ is_dyn_quant = config . get ( "is_dyn_quant" , False )
152
152
return cls (is_dyn_quant = is_dyn_quant )
153
153
154
154
def name (self ) -> str :
@@ -168,7 +168,7 @@ def __init__(
168
168
169
169
@classmethod
170
170
def from_config (cls , config : dict ) -> "WINT4Config" :
171
- is_dyn_quant = config [ "is_dyn_quant" ] if "is_dyn_quant" in config else False
171
+ is_dyn_quant = config . get ( "is_dyn_quant" , False )
172
172
return cls (is_dyn_quant = is_dyn_quant )
173
173
174
174
def name (self ) -> str :
You can’t perform that action at this time.
0 commit comments