File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 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]:
377377 if len (tuning_param_list ) == 0 :
378378 config_list = [config ]
379379 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 ))
380383 tuning_param_name_lst = [tuning_param .name for tuning_param in tuning_param_list ]
381384 for params_values in product (* [tuning_param .options for tuning_param in tuning_param_list ]):
382385 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):
277277 for i in range (len (configs_list )):
278278 self .assertEqual (configs_list [i ].target_op_type_list , target_op_type_list_options [i ])
279279
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+
280285 def test_mixed_two_algos (self ):
281286 model = FakeModel ()
282287 OP1_NAME = "OP1_NAME"
You can’t perform that action at this time.
0 commit comments