@@ -189,8 +189,8 @@ def __call__(self, searchspace: SearchSpace, train_x: Tensor, train_y: Tensor):
189189 # Temporarily narrow the supported parameter kinds to those of the original
190190 # class. If the decorator logic is correct, the original factory should never
191191 # see the extended scope, but this acts as a sanity check to prevent regressions
192- broadened_kinds = target_cls ._supported_parameter_kinds # type: ignore[attr-defined]
193- target_cls ._supported_parameter_kinds = original_supported_kinds # type: ignore[attr-defined]
192+ broadened_kinds = target_cls ._supported_parameter_kinds
193+ target_cls ._supported_parameter_kinds = original_supported_kinds
194194
195195 # Split off the task parameters
196196 original_selector = self .parameter_selector
@@ -204,7 +204,7 @@ def __call__(self, searchspace: SearchSpace, train_x: Tensor, train_y: Tensor):
204204 try :
205205 base_kernel = original_call (self , searchspace , train_x , train_y )
206206 finally :
207- target_cls ._supported_parameter_kinds = broadened_kinds # type: ignore[attr-defined]
207+ target_cls ._supported_parameter_kinds = broadened_kinds
208208 self .parameter_selector = original_selector
209209
210210 if searchspace .task_idx is not None :
@@ -213,7 +213,7 @@ def __call__(self, searchspace: SearchSpace, train_x: Tensor, train_y: Tensor):
213213 return base_kernel
214214
215215 target_cls .__call__ = __call__ # type: ignore[method-assign]
216- target_cls ._supported_parameter_kinds = ( # type: ignore[attr-defined]
216+ target_cls ._supported_parameter_kinds = (
217217 cls ._supported_parameter_kinds | _ParameterKind .TASK
218218 )
219219 return target_cls
0 commit comments