File tree 2 files changed +8
-0
lines changed
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -377,6 +377,9 @@ def expand(self) -> List[BaseConfig]:
377
377
if len (tuning_param_list ) == 0 :
378
378
config_list = [config ]
379
379
else :
380
+ # The `TuningParam` instance with no options will cause the product to be empty.
381
+ # Filter out the `TuningParam` instances with no options
382
+ tuning_param_list = list (filter (lambda x : len (x .options ) > 0 , tuning_param_list ))
380
383
tuning_param_name_lst = [tuning_param .name for tuning_param in tuning_param_list ]
381
384
for params_values in product (* [tuning_param .options for tuning_param in tuning_param_list ]):
382
385
tuning_param_pair = dict (zip (tuning_param_name_lst , params_values ))
Original file line number Diff line number Diff line change @@ -277,6 +277,11 @@ def test_config_expand_complex_tunable_type(self):
277
277
for i in range (len (configs_list )):
278
278
self .assertEqual (configs_list [i ].target_op_type_list , target_op_type_list_options [i ])
279
279
280
+ def test_config_expand_with_empty_options (self ):
281
+ configs = FakeAlgoConfig (weight_dtype = ["int" , "float32" ], weight_bits = [])
282
+ configs_list = configs .expand ()
283
+ self .assertEqual (len (configs_list ), 2 )
284
+
280
285
def test_mixed_two_algos (self ):
281
286
model = FakeModel ()
282
287
OP1_NAME = "OP1_NAME"
You can’t perform that action at this time.
0 commit comments