File tree Expand file tree Collapse file tree
baybe/surrogates/gaussian_process/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,13 +96,7 @@ def _is_gpytorch_component_class(obj: Any, /) -> bool:
9696
9797def _validate_component (instance : Any , attribute : Attribute , value : Any ) -> None :
9898 """Validate that an object is a BayBE or a GPyTorch GP component."""
99- from baybe .surrogates .gaussian_process .components .criterion import Criterion
100-
101- if (
102- isinstance (value , Kernel )
103- or isinstance (value , Criterion )
104- or _is_gpytorch_component_class (type (value ))
105- ):
99+ if isinstance (value , BayBEGPComponent ) or _is_gpytorch_component_class (type (value )):
106100 return
107101
108102 raise TypeError (
@@ -153,13 +147,7 @@ def to_component_factory(
153147 Raises:
154148 TypeError: If the given component does not match the allowed types.
155149 """
156- from baybe .surrogates .gaussian_process .components .criterion import Criterion
157-
158- if (
159- isinstance (obj , BayBEGPComponent )
160- or isinstance (obj , Criterion )
161- or _is_gpytorch_component_class (type (obj ))
162- ):
150+ if isinstance (obj , BayBEGPComponent ) or _is_gpytorch_component_class (type (obj )):
163151 if component_type is not None :
164152 allowed_types = component_type .get_types ()
165153 if not isinstance (obj , allowed_types ):
You can’t perform that action at this time.
0 commit comments